diff options
Diffstat (limited to 'src/app/impl_self.rs')
-rw-r--r-- | src/app/impl_self.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/app/impl_self.rs b/src/app/impl_self.rs index 2450bff..95f1871 100644 --- a/src/app/impl_self.rs +++ b/src/app/impl_self.rs | |||
@@ -230,6 +230,29 @@ impl App { | |||
230 | Command::TrackDown(name) => { | 230 | Command::TrackDown(name) => { |
231 | _track(&name, TrackEvent::Decrement); | 231 | _track(&name, TrackEvent::Decrement); |
232 | } | 232 | } |
233 | Command::Help(input) => { | ||
234 | if let Some(topic) = input.as_ref().map(String::as_ref) { | ||
235 | self.message.set_message( | ||
236 | match topic { | ||
237 | "a" | "add" => "add <habit-name> [goal] (alias: a)", | ||
238 | "aa" | "add-auto" => "add-auto <habit-name> [goal] (alias: aa)", | ||
239 | "d" | "delete" => "delete <habit-name> (alias: d)", | ||
240 | "mprev" | "month-prev" => "month-prev (alias: mprev)", | ||
241 | "mnext" | "month-next" => "month-next (alias: mnext)", | ||
242 | "tup" | "track-up" => "track-up <auto-habit-name> (alias: tup)", | ||
243 | "tdown" | "track-down" => "track-down <auto-habit-name> (alias: tdown)", | ||
244 | "q" | "quit" => "quit", | ||
245 | "h"|"?" | "help" => "help [<command>|commands|keys] (aliases: h, ?)", | ||
246 | "cmds" | "commands" => "add, add-auto, delete, month-{prev,next}, track-{up,down}, help, quit", | ||
247 | "keys" => "TODO", // TODO (view?) | ||
248 | _ => "unknown command or help topic.", | ||
249 | } | ||
250 | ) | ||
251 | } else { | ||
252 | // TODO (view?) | ||
253 | self.message.set_message("help <command>|commands|keys") | ||
254 | } | ||
255 | } | ||
233 | Command::Quit => self.save_state(), | 256 | Command::Quit => self.save_state(), |
234 | Command::MonthNext => self.sift_forward(), | 257 | Command::MonthNext => self.sift_forward(), |
235 | Command::MonthPrev => self.sift_backward(), | 258 | Command::MonthPrev => self.sift_backward(), |