From 132de644b77b42174ab470ea653352b05f4eca8d Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 1 Oct 2017 20:55:15 -0700 Subject: extract commands and twitter model into modules --- commands/quit.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 commands/quit.rs (limited to 'commands/quit.rs') 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); +} -- cgit v1.1