From c731b470fc162e56f6d81c475bacb41230a5e2d3 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 31 May 2019 02:51:16 +0200 Subject: add option to filter based on boss --- src/main.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/main.rs') 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, + /// Only show logs from the given encounters. + #[structopt( + short = "e", + long = "bosses", + default_value = "*", + )] + bosses: CommaSeparatedList, + /// Print more debugging information to stderr. #[structopt(long = "debug")] debug: bool, @@ -317,7 +325,10 @@ fn search_log(entry: &DirEntry, opt: &Opt) -> Result, 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) } -- cgit v1.2.3