aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/app.rs b/src/app.rs
index 412cfe5..93e5def 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -190,11 +190,15 @@ impl App {
190 pub fn parse_command(&mut self, input: &str) { 190 pub fn parse_command(&mut self, input: &str) {
191 let c = Command::from_string(input); 191 let c = Command::from_string(input);
192 match c { 192 match c {
193 Command::Add(name, kind, goal) => { 193 Command::Add(name, kind, goal, auto) => {
194 if kind == "count" { 194 if kind == "count" {
195 self.add_habit(Box::new(Count::new(name, goal.unwrap_or(0)))); 195 self.add_habit(Box::new(Count::new(
196 name,
197 goal.unwrap_or(0),
198 auto.unwrap_or(false),
199 )));
196 } else if kind == "bit" { 200 } else if kind == "bit" {
197 self.add_habit(Box::new(Bit::new(name))); 201 self.add_habit(Box::new(Bit::new(name, auto.unwrap_or(false))));
198 } 202 }
199 } 203 }
200 Command::Delete(name) => { 204 Command::Delete(name) => {