Auto merge of #36 - matthiasbeyer:bm-list-filter, r=matthiasbeyer
BM::command_list() add filter functionality Adds missing filter functionality for BM subcommand `list`.
This commit is contained in:
commit
6c92b2300c
1 changed files with 8 additions and 2 deletions
|
@ -113,10 +113,16 @@ impl<'a> BM<'a> {
|
|||
use std::ops::Deref;
|
||||
|
||||
let parser = Parser::new(JsonHeaderParser::new(None));
|
||||
let files = self.rt.store().load_for_module(self, &parser);
|
||||
let filter : Box<CliFileFilter> = get_file_filter_by_cli(&parser, matches, "id", "match", "tags", Some("URL"));
|
||||
|
||||
let files = self.rt
|
||||
.store()
|
||||
.load_for_module(self, &parser)
|
||||
.into_iter()
|
||||
.filter(|file| filter.filter_file(file));
|
||||
let printer = TablePrinter::new(self.rt.is_verbose(), self.rt.is_debugging());
|
||||
|
||||
printer.print_files_custom(files.into_iter(),
|
||||
printer.print_files_custom(files,
|
||||
&|file| {
|
||||
let fl = file.deref().borrow();
|
||||
let hdr = fl.header();
|
||||
|
|
Loading…
Reference in a new issue