mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-26 22:06:26 +00:00
details: filter
is only used when recursing
So move it as part of 'recurse's option.
This commit is contained in:
parent
abf7bf7a3e
commit
f9f1c991cb
@ -233,9 +233,8 @@ impl View {
|
||||
let details = Details {
|
||||
columns: try!(Columns::deduce(matches)),
|
||||
header: matches.opt_present("header"),
|
||||
recurse: dir_action.recurse_options(),
|
||||
recurse: dir_action.recurse_options().map(|o| (o, filter)),
|
||||
xattr: xattr::feature_implemented() && matches.opt_present("extended"),
|
||||
filter: filter,
|
||||
};
|
||||
|
||||
Ok(View::Details(details))
|
||||
|
@ -12,9 +12,8 @@ use ansi_term::Style::Plain;
|
||||
pub struct Details {
|
||||
pub columns: Columns,
|
||||
pub header: bool,
|
||||
pub recurse: Option<RecurseOptions>,
|
||||
pub recurse: Option<(RecurseOptions, FileFilter)>,
|
||||
pub xattr: bool,
|
||||
pub filter: FileFilter,
|
||||
}
|
||||
|
||||
impl Details {
|
||||
@ -41,14 +40,14 @@ impl Details {
|
||||
for (index, file) in src.iter().enumerate() {
|
||||
table.add_row(file, depth, index == src.len() - 1);
|
||||
|
||||
if let Some(r) = self.recurse {
|
||||
if let Some((r, filter)) = self.recurse {
|
||||
if r.tree == false || r.is_too_deep(depth) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Some(ref dir) = file.this {
|
||||
let mut files = dir.files(true);
|
||||
self.filter.transform_files(&mut files);
|
||||
filter.transform_files(&mut files);
|
||||
self.add_files_to_table(table, &files, depth + 1);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user