aboutsummaryrefslogtreecommitdiff
path: root/commands/mod.rs
diff options
context:
space:
mode:
authorAndy Wortman <ixineeringeverywhere@gmail.com>2017-10-01 20:55:15 -0700
committerAndy Wortman <ixineeringeverywhere@gmail.com>2017-10-01 20:55:15 -0700
commite6ebf2c99a70bd5ee4e8d07097e6b128c3630714 (patch)
tree476947a6f2937737bc69ca073a2519bd9f15b1fe /commands/mod.rs
parentaf67981a2a1c28b3b5598f74d48bfd3a7490c91a (diff)
extract commands and twitter model into modules
Diffstat (limited to 'commands/mod.rs')
-rw-r--r--commands/mod.rs46
1 files changed, 46 insertions, 0 deletions
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,
+ &QUOTE,
+ &RETWETE,
+ &REP,
+ &THREAD
+ ];
+ */
+];