diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-10-01 20:55:15 -0700 |
---|---|---|
committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-10-01 20:55:15 -0700 |
commit | e6ebf2c99a70bd5ee4e8d07097e6b128c3630714 (patch) | |
tree | 476947a6f2937737bc69ca073a2519bd9f15b1fe /commands/quit.rs | |
parent | af67981a2a1c28b3b5598f74d48bfd3a7490c91a (diff) |
extract commands and twitter model into modules
Diffstat (limited to 'commands/quit.rs')
-rw-r--r-- | commands/quit.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/commands/quit.rs b/commands/quit.rs new file mode 100644 index 0000000..982c48f --- /dev/null +++ b/commands/quit.rs @@ -0,0 +1,18 @@ +use tw; +use ::Queryer; + +use commands::Command; + +use std::process::exit; + +pub static QUIT: Command = Command { + keyword: "q", + params: 0, + exec: quit +}; + +fn quit(_line: String, tweeter: &mut tw::TwitterCache, _queryer: &mut Queryer) { + println!("Bye bye!"); + tweeter.store_cache(); + exit(0); +} |