aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorTill Hoeppner2015-03-24 23:47:03 +0100
committerTill Hoeppner2015-03-24 23:47:29 +0100
commitbead9324f053957f73042b1e33905aaa73b57649 (patch)
tree27ad07702fff7f6bfcf388b93b1bd1d27ab70a84 /src/main.rs
parentd972eed6b596d415a0aa6117a05bd107dbb8a0ae (diff)
downloadilc-bead9324f053957f73042b1e33905aaa73b57649.tar.gz
ilc-bead9324f053957f73042b1e33905aaa73b57649.tar.xz
ilc-bead9324f053957f73042b1e33905aaa73b57649.zip
Partial parsing/formatting of weechat3, plus basic CLI interface
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 1bdf090..b5f65a9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,11 +8,11 @@ extern crate libc;
extern crate regex;
use std::fs::File;
-use std::io::BufReader;
+use std::io::{ self, BufReader };
use docopt::Docopt;
-use ilc::format::{ self, Decode };
+use ilc::format::{ self, Encode, Decode };
static USAGE: &'static str = "
A converter and statistics utility for IRC log files.
@@ -47,8 +47,10 @@ fn main() {
for file in args.arg_file {
let f: BufReader<File> = BufReader::new(File::open(file).unwrap());
let iter = parser.decode(f);
- println!("Obtained event iterator");
- for e in iter { println!("{:?}", e) }
+ let events: Vec<_> = iter.collect();
+ for e in events {
+ parser.encode(io::stdout(), &e.unwrap());
+ }
}
}
}