From ef3f556099a3f13ae0c9d0719994805e4682cce7 Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 15 Jul 2020 21:17:14 +0530 Subject: make `add` command easier to use --- src/app.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/app.rs') diff --git a/src/app.rs b/src/app.rs index 81a574a..dafeed5 100644 --- a/src/app.rs +++ b/src/app.rs @@ -208,7 +208,8 @@ impl App { pub fn parse_command(&mut self, input: &str) { let c = Command::from_string(input); match c { - Command::Add(name, kind, goal, auto) => { + Command::Add(name, goal, auto) => { + let kind = if goal == Some(1) { "bit" } else { "count" }; if kind == "count" { self.add_habit(Box::new(Count::new( name, -- cgit v1.2.3