From 74c3431a2bf74ce78c26974f3cc07570e1d3baf3 Mon Sep 17 00:00:00 2001 From: gorogoroumaru Date: Thu, 10 Sep 2020 15:34:27 +0900 Subject: [PATCH] improve time option usage (#645) * improve time option usage --- src/app.rs | 2 ++ src/filter/time.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/app.rs b/src/app.rs index 9abd51c..7cc7164 100644 --- a/src/app.rs +++ b/src/app.rs @@ -412,6 +412,7 @@ pub fn build_app() -> App<'static, 'static> { Arg::with_name("changed-within") .long("changed-within") .alias("change-newer-than") + .alias("newer") .takes_value(true) .value_name("date|dur") .number_of_values(1) @@ -429,6 +430,7 @@ pub fn build_app() -> App<'static, 'static> { Arg::with_name("changed-before") .long("changed-before") .alias("change-older-than") + .alias("older") .takes_value(true) .value_name("date|dur") .number_of_values(1) diff --git a/src/filter/time.rs b/src/filter/time.rs index 185cfd0..ca37f94 100644 --- a/src/filter/time.rs +++ b/src/filter/time.rs @@ -12,6 +12,7 @@ impl TimeFilter { humantime::parse_duration(s) .map(|duration| *ref_time - duration) .or_else(|_| humantime::parse_rfc3339_weak(s)) + .or_else(|_| humantime::parse_rfc3339_weak(&(s.to_owned() + " 00:00:00"))) .ok() }