aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorAndy Wortman <ixineeringeverywhere@gmail.com>2017-11-11 04:35:35 -0800
committerAndy Wortman <ixineeringeverywhere@gmail.com>2017-11-11 16:00:31 -0800
commit73dc5dda6b8ca8a8bdae0f620442e359871b0152 (patch)
tree1a3a0ff74bedf1788079ba642eb222f6a4d23c9d /src/main.rs
parent3601bf6433d46dea4dd1960f7a3cdc514602983d (diff)
start adding help reference
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 37f190e..f2842c4 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -380,6 +380,15 @@ fn do_ui(ui_rx_orig: chan::Receiver<Result<termion::event::Event, std::io::Error
};
match tweeter.state {
+ tw::AppState::ShowHelp => {
+ let mut help_lines = vec![];
+ for command in commands::COMMANDS {
+ help_lines.push(format!("{} {}", command.keyword, command.help_str));
+ }
+ tweeter.display_info.infos.push(display::Infos::Text(help_lines));
+ display::paint(tweeter).unwrap();
+ tweeter.state = tw::AppState::View;
+ }
tw::AppState::Reconnect => {
tweeter.state = tw::AppState::View;
return Some((ui_rx_orig.clone(), tweeter.profile.clone().map(|creds| connect_twitter_stream(tweeter.app_key.clone(), creds))));