diff options
author | Till Höppner | 2015-06-11 20:57:39 +0200 |
---|---|---|
committer | Till Höppner | 2015-06-11 20:57:39 +0200 |
commit | bc755a4dedc520b672bc7168ff6ef9d088072d99 (patch) | |
tree | 52bed0ed50693bb9f5bbdc52fa81d7e1edfb855c /src/main.rs | |
parent | 86fe3230866082d6207eb5253f2e89623b941f63 (diff) | |
parent | ccc9f5e8eaa84579da610ea0d90d18596078bac7 (diff) | |
download | ilc-bc755a4dedc520b672bc7168ff6ef9d088072d99.tar.gz ilc-bc755a4dedc520b672bc7168ff6ef9d088072d99.tar.xz ilc-bc755a4dedc520b672bc7168ff6ef9d088072d99.zip |
Merge pull request #1 from tilpner/cows
Update Event API with Option and Cow
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 99e2659..de5f85c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,6 +16,7 @@ #![plugin(regex_macros)] extern crate ilc; +extern crate chrono; extern crate docopt; extern crate rustc_serialize; extern crate libc; @@ -29,6 +30,10 @@ use std::io::{ self, BufReader }; use docopt::Docopt; +use chrono::offset::fixed::FixedOffset; +use chrono::naive::date::NaiveDate; + +use ilc::context::Context; use ilc::format::{ self, Encode, Decode }; static USAGE: &'static str = r#" @@ -71,13 +76,18 @@ fn main() { } if args.cmd_parse { - let mut parser = format::weechat3::Weechat3; + let context = Context { + timezone: FixedOffset::west(0), + override_date: NaiveDate::from_ymd(2015, 6, 10) + }; + let mut parser = format::energymech::Energymech; + let formatter = format::energymech::Energymech; for file in args.arg_file { let f: BufReader<File> = BufReader::new(File::open(file).unwrap()); - let iter = parser.decode(f); + let iter = parser.decode(&context, f); for e in iter { info!("Parsed: {:?}", e); - drop(parser.encode(io::stdout(), &e.unwrap())); + drop(formatter.encode(&context, io::stdout(), &e.unwrap())); } } } |