From 155971b36c100c0c146492375d5580ef0c5ac572 Mon Sep 17 00:00:00 2001 From: Till Höppner Date: Wed, 16 Mar 2016 17:17:25 +0100 Subject: Add time_out param, change timezone handling --- cli/src/lib.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'cli/src') diff --git a/cli/src/lib.rs b/cli/src/lib.rs index f4cc077..79953e4 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -64,11 +64,16 @@ pub fn main(cli: Cli) { .author("Till Höppner ") .about("A converter and statistics utility for IRC log files") .arg(Arg::with_name("time") - .help("Timestamp offset, in seconds") + .help("Timestamp offset of input events, in seconds") .global(true) .takes_value(true) - .long("timeoffset") + .long("time_in") .short("t")) + .arg(Arg::with_name("time_out") + .help("Timestamp offset for output events, in seconds") + .global(true) + .takes_value(true) + .long("time_out")) .arg(Arg::with_name("date") .help("Override the date for this log, ISO 8601, YYYY-MM-DD") .global(true) @@ -390,9 +395,12 @@ impl<'a> Environment<'a> { pub fn build_context(args: &ArgMatches) -> Context { let mut context = Context { - timezone: FixedOffset::west(args.value_of("time") - .and_then(|s| s.parse::().ok()) - .unwrap_or(0)), + timezone_in: FixedOffset::east(args.value_of("time") + .and_then(|s| s.parse::().ok()) + .unwrap_or(0)), + timezone_out: FixedOffset::east(args.value_of("time_out") + .and_then(|s| s.parse::().ok()) + .unwrap_or(0)), override_date: args.value_of("date").and_then(|d| NaiveDate::from_str(&d).ok()), channel: args.value_of("channel").map(str::to_owned).clone(), }; -- cgit v1.2.3