From cd26b1a82a94181211b6d353cd99dd5571b274f0 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Sun, 1 Feb 2026 11:41:14 -0700 Subject: [PATCH] parse add --- pttodoest/src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pttodoest/src/main.rs b/pttodoest/src/main.rs index 001167a..9f4e818 100755 --- a/pttodoest/src/main.rs +++ b/pttodoest/src/main.rs @@ -111,8 +111,18 @@ mod test_flags { } } -fn add(files: Vec, add: String, add_schedule: Option) -> Result<(), String> { - Err("not impl".to_string()) +fn add(files: Vec, added: String, add_schedule: Option) -> Result<(), String> { + let task = match add_schedule.clone() { + None => serde_yaml::Value::String(added), + Some(add_schedule) => { + let mut m = serde_yaml::Mapping::new(); + m.insert("schedule".into(), add_schedule.into()); + m.insert("do".into(), added.into()); + serde_yaml::Value::Mapping(m) + } + }; + + panic!("append {:?} to {:?}", &task, &files); } fn reconcile(files: Vec) -> Result<(), String> {