aboutsummaryrefslogtreecommitdiff
path: root/src/format
diff options
context:
space:
mode:
authorTill Höppner2016-02-03 03:38:32 +0100
committerTill Höppner2016-02-03 03:38:32 +0100
commitcadd814c28b03205c8277530ef09bffcdba44ec6 (patch)
tree0314a1ee2e87f4f3eedde42b5fe685610b98d1db /src/format
parentc4acc192d9e6b023334156706b9974006652d6d6 (diff)
downloadilc-cadd814c28b03205c8277530ef09bffcdba44ec6.tar.gz
ilc-cadd814c28b03205c8277530ef09bffcdba44ec6.tar.xz
ilc-cadd814c28b03205c8277530ef09bffcdba44ec6.zip
Docopt -> clap, main.rs -> src/app
Modularise the old main function, switch to clap for easier addition of CLI arguments
Diffstat (limited to 'src/format')
-rw-r--r--src/format/mod.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/format/mod.rs b/src/format/mod.rs
index ff3a328..f7de677 100644
--- a/src/format/mod.rs
+++ b/src/format/mod.rs
@@ -25,6 +25,7 @@ use context::Context;
pub mod energymech;
pub mod weechat3;
+// pub mod irssi;
pub mod binary;
pub mod msgpack;
@@ -46,8 +47,9 @@ impl Decode for Dummy {
pub fn decoder(format: &str) -> Option<Box<Decode>> {
match format {
- "energymech" => Some(Box::new(energymech::Energymech)),
- "weechat3" => Some(Box::new(weechat3::Weechat3)),
+ "energymech" | "em" => Some(Box::new(energymech::Energymech)),
+ "weechat3" | "weechat" | "w3" => Some(Box::new(weechat3::Weechat3)),
+// "irssi" => Some(Box::new(irssi::Irssi)),
"binary" => Some(Box::new(binary::Binary)),
"msgpack" => Some(Box::new(msgpack::Msgpack)),
_ => None
@@ -56,8 +58,9 @@ pub fn decoder(format: &str) -> Option<Box<Decode>> {
pub fn encoder(format: &str) -> Option<Box<Encode>> {
match format {
- "energymech" => Some(Box::new(energymech::Energymech)),
- "weechat3" => Some(Box::new(weechat3::Weechat3)),
+ "energymech" | "em" => Some(Box::new(energymech::Energymech)),
+ "weechat3" | "weechat" | "w3" => Some(Box::new(weechat3::Weechat3)),
+// "irssi" => Some(Box::new(irssi::Irssi)),
"binary" => Some(Box::new(binary::Binary)),
"msgpack" => Some(Box::new(msgpack::Msgpack)),
_ => None