diff options
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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<FightOutcome>, + /// 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<Option<LogResult>, 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); |