From 3ded40d04f49983e7907366536dbc94917cee666 Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 14 Jul 2020 17:20:36 +0530 Subject: more boilerplate for auto-trackable habits add funding.yml also :^) --- src/command.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/command.rs') diff --git a/src/command.rs b/src/command.rs index afc00ba..c1a855e 100644 --- a/src/command.rs +++ b/src/command.rs @@ -27,7 +27,7 @@ fn call_on_app(s: &mut Cursive, input: &str) { #[derive(PartialEq)] pub enum Command { - Add(String, String, Option), // habit name, habit type, optional goal + Add(String, String, Option, Option), // habit name, habit type, optional goal, auto tracked MonthPrev, MonthNext, Delete(String), @@ -50,10 +50,12 @@ impl Command { return Command::Blank; } let goal = args.get(2).map(|g| g.parse::().ok()).flatten(); + let auto = args.get(3).map(|g| g.parse::().ok()).flatten(); return Command::Add( args.get_mut(0).unwrap().to_string(), args.get_mut(1).unwrap().to_string(), goal, + auto, ); } "delete" | "d" => { -- cgit v1.2.3