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/mod.rs | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 commands/mod.rs (limited to 'commands/mod.rs') diff --git a/commands/mod.rs b/commands/mod.rs new file mode 100644 index 0000000..fc66bec --- /dev/null +++ b/commands/mod.rs @@ -0,0 +1,46 @@ +use tw; +use ::Queryer; + +pub struct Command { + pub keyword: &'static str, + pub params: u8, + pub exec: fn(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer) +} + +mod show_cache; +mod twete; +mod look_up; +mod view; +mod quit; +mod fav; + +pub static COMMANDS: &[&Command] = &[ + &show_cache::SHOW_CACHE, + &quit::QUIT, + &look_up::LOOK_UP_USER, + &look_up::LOOK_UP_TWEET, + &view::VIEW, + &fav::UNFAV, + &fav::FAV, + &twete::DEL, + &twete::TWETE, + &twete::QUOTE, + &twete::RETWETE, + &twete::REP, + &twete::THREAD + /* + &QUIT, + &LOOK_UP_USER, + &LOOK_UP_TWEET, + &VIEW, + &UNFAV, + &FAV, + &DEL, + &TWETE, + "E, + &RETWETE, + &REP, + &THREAD + ]; + */ +]; -- cgit v1.1