mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Feature: Filter by invert_filter: reverse match
Mimic grep's -v option. Allows dust to only match files that do not match the given filter
This commit is contained in:
@@ -64,6 +64,13 @@ pub fn is_filtered_out_due_to_regex(filter_regex: &Option<Regex>, dir: &Path) ->
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_filtered_out_due_to_invert_regex(filter_regex: &Option<Regex>, dir: &Path) -> bool {
|
||||
match filter_regex {
|
||||
Some(fr) => fr.is_match(&dir.as_os_str().to_string_lossy()),
|
||||
None => false,
|
||||
}
|
||||
}
|
||||
|
||||
fn is_a_parent_of<P: AsRef<Path>>(parent: P, child: P) -> bool {
|
||||
let parent = parent.as_ref();
|
||||
let child = child.as_ref();
|
||||
|
||||
Reference in New Issue
Block a user