aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2019-05-18 00:43:23 +0200
committerDaniel <kingdread@gmx.de>2019-05-18 00:43:23 +0200
commitcc4c270f5101848b8ad922b1efda678fdf377dab (patch)
tree5612e3e8fef53420c033a7f87c94af3232644ca3 /src/main.rs
parentf9ae935034a294606931d038329325aba46a7b6f (diff)
downloadraidgrep-cc4c270f5101848b8ad922b1efda678fdf377dab.tar.gz
raidgrep-cc4c270f5101848b8ad922b1efda678fdf377dab.tar.bz2
raidgrep-cc4c270f5101848b8ad922b1efda678fdf377dab.zip
add support for -v to invert matches
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
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);