From 0a7e6873a3462f85c77ca66662dfcae60ae82b81 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:39:17 -0700 Subject: [PATCH] can -s 2025-01-02 --- pttodoest/src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pttodoest/src/main.rs b/pttodoest/src/main.rs index fede449..e701077 100755 --- a/pttodoest/src/main.rs +++ b/pttodoest/src/main.rs @@ -15,8 +15,15 @@ fn main() { } if let Some(add) = flags.add { - let task = Task(serde_yaml::Value::String(add)); - panic!("TODO flags.add_schedule"); + let task = match flags.add_schedule { + None => Task(serde_yaml::Value::String(add)), + Some(add_schedule) => { + let mut m = serde_yaml::Mapping::new(); + m.insert("schedule".into(), add_schedule.into()); + m.insert("todo".into(), add.into()); + Task(serde_yaml::Value::Mapping(m)) + } + }; files.files[0] .append(Delta::add(task)) .expect("failed to add");