aboutsummaryrefslogtreecommitdiff
path: root/src/commands/quit.rs
diff options
context:
space:
mode:
authorAndy Wortman <ixineeringeverywhere@gmail.com>2017-10-02 01:27:08 -0700
committerAndy Wortman <ixineeringeverywhere@gmail.com>2017-10-02 01:27:18 -0700
commitea4e93f01d9e4ef17effae1e9a807bb1977865fe (patch)
tree08cfbcc32b9fbea5f13fd3447026090f51402274 /src/commands/quit.rs
parentafd61ae0822690f30d37859c806a8d8d843b8c1a (diff)
move everything to src/
Diffstat (limited to 'src/commands/quit.rs')
-rw-r--r--src/commands/quit.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/commands/quit.rs b/src/commands/quit.rs
new file mode 100644
index 0000000..982c48f
--- /dev/null
+++ b/src/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);
+}