diff options
Diffstat (limited to 'src/command.rs')
-rw-r--r-- | src/command.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/command.rs b/src/command.rs index c4f20fc..f94eab8 100644 --- a/src/command.rs +++ b/src/command.rs | |||
@@ -17,10 +17,10 @@ fn call_on_app(s: &mut Cursive, input: &str) { | |||
17 | } | 17 | } |
18 | 18 | ||
19 | pub enum Command { | 19 | pub enum Command { |
20 | Add(String, String, Option<u32>), | 20 | Add(String, String, Option<u32>), // habit name, habit type, optional goal |
21 | MonthPrev, | 21 | MonthPrev, |
22 | MonthNext, | 22 | MonthNext, |
23 | Delete, | 23 | Delete(String), |
24 | Blank, | 24 | Blank, |
25 | } | 25 | } |
26 | 26 | ||
@@ -45,6 +45,12 @@ impl Command { | |||
45 | goal, | 45 | goal, |
46 | ); | 46 | ); |
47 | } | 47 | } |
48 | "delete" | "d" => { | ||
49 | if args.len() < 1 { | ||
50 | return Command::Blank; | ||
51 | } | ||
52 | return Command::Delete(args[0].to_string()); | ||
53 | } | ||
48 | "mprev" | "month-prev" => return Command::MonthPrev, | 54 | "mprev" | "month-prev" => return Command::MonthPrev, |
49 | "mnext" | "month-next" => return Command::MonthNext, | 55 | "mnext" | "month-next" => return Command::MonthNext, |
50 | _ => return Command::Blank, | 56 | _ => return Command::Blank, |