diff options
author | Daniel <kingdread@gmx.de> | 2019-05-31 02:51:16 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2019-05-31 02:51:16 +0200 |
commit | c731b470fc162e56f6d81c475bacb41230a5e2d3 (patch) | |
tree | 926a46c99d465b4da362c6583364b11bb6109771 /src/main.rs | |
parent | 9243e9c6cc6cdefe1565291a2933cc58556ebe9b (diff) | |
download | raidgrep-c731b470fc162e56f6d81c475bacb41230a5e2d3.tar.gz raidgrep-c731b470fc162e56f6d81c475bacb41230a5e2d3.tar.bz2 raidgrep-c731b470fc162e56f6d81c475bacb41230a5e2d3.zip |
add option to filter based on boss
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 87ebbb0..89dab09 100644 --- a/src/main.rs +++ b/src/main.rs @@ -123,6 +123,14 @@ pub struct Opt { )] weekdays: CommaSeparatedList<Weekday>, + /// Only show logs from the given encounters. + #[structopt( + short = "e", + long = "bosses", + default_value = "*", + )] + bosses: CommaSeparatedList<evtclib::statistics::gamedata::Boss>, + /// Print more debugging information to stderr. #[structopt(long = "debug")] debug: bool, @@ -317,7 +325,10 @@ fn search_log(entry: &DirEntry, opt: &Opt) -> Result<Option<LogResult>, RuntimeE let mut stream = wrapper.get_stream(); let partial = evtclib::raw::parser::parse_partial_file(&mut stream)?; - if filters::filter_name(&partial, opt) == opt.invert { + let early_ok = filters::filter_name(&partial, opt) != opt.invert + && filters::filter_boss(&partial, opt); + + if !early_ok { return Ok(None) } |