diff options
author | Daniel <kingdread@gmx.de> | 2019-05-18 00:43:23 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2019-05-18 00:43:23 +0200 |
commit | cc4c270f5101848b8ad922b1efda678fdf377dab (patch) | |
tree | 5612e3e8fef53420c033a7f87c94af3232644ca3 /src | |
parent | f9ae935034a294606931d038329325aba46a7b6f (diff) | |
download | raidgrep-cc4c270f5101848b8ad922b1efda678fdf377dab.tar.gz raidgrep-cc4c270f5101848b8ad922b1efda678fdf377dab.tar.bz2 raidgrep-cc4c270f5101848b8ad922b1efda678fdf377dab.zip |
add support for -v to invert matches
Diffstat (limited to 'src')
-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); |