feat: new param: ignore-all-in-file

Add new cmd line param to ignore all files or directories listed in this
file
This commit is contained in:
andy.boot
2023-12-13 22:39:51 +00:00
parent e8c7990a17
commit cd53fc7494
11 changed files with 62 additions and 4 deletions

View File

@@ -1 +1,2 @@
hi
something
.secret

View File

View File

@@ -64,6 +64,7 @@ pub fn test_d_flag_works_and_still_recurses_down() {
// We had a bug where running with '-d 1' would stop at the first directory and the code
// would fail to recurse down
let output = build_command(vec!["-d", "1", "-f", "-c", "tests/test_dir2/"]);
assert!(output.contains("1 ┌── dir"));
assert!(output.contains("4 ┌─┴ test_dir2"));
}
@@ -73,7 +74,18 @@ pub fn test_ignore_dir() {
let output = build_command(vec!["-c", "-X", "dir_substring", "tests/test_dir2/"]);
assert!(!output.contains("dir_substring"));
}
// Add test for multiple dirs - with -d 0 and maybe -d 1 check the
#[test]
pub fn test_ignore_all_in_file() {
let output = build_command(vec![
"-c",
"-I",
"tests/test_dir_hidden_entries/.hidden_file",
"tests/test_dir_hidden_entries/",
]);
assert!(output.contains(" test_dir_hidden_entries"));
assert!(!output.contains(".secret"));
}
#[test]
pub fn test_with_bad_param() {