From cc4c270f5101848b8ad922b1efda678fdf377dab Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 18 May 2019 00:43:23 +0200 Subject: add support for -v to invert matches --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index e63eb44..7d3c93d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,6 +85,10 @@ pub struct Opt { #[structopt(short = "o", long = "outcome", default_value = "*")] outcome: CommaSeparatedList, + /// Invert the regular expression (show fights that do not match) + #[structopt(short = "v", long = "invert-match")] + invert: bool, + /// Disable colored output. #[structopt(long = "no-color")] no_color: bool, @@ -273,7 +277,7 @@ fn search_log(entry: &DirEntry, opt: &Opt) -> Result, RuntimeE let info = extract_info(entry, &log); - let take_log = filters::filter_name(&log, opt) + let take_log = filters::filter_name(&log, opt) == !opt.invert && filters::filter_outcome(&info, opt) && filters::filter_time(&info, opt); -- cgit v1.2.3