From cadd814c28b03205c8277530ef09bffcdba44ec6 Mon Sep 17 00:00:00 2001 From: Till Höppner Date: Wed, 3 Feb 2016 03:38:32 +0100 Subject: Docopt -> clap, main.rs -> src/app Modularise the old main function, switch to clap for easier addition of CLI arguments --- src/format/mod.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/format') 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> { 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> { pub fn encoder(format: &str) -> Option> { 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 -- cgit v1.2.3