mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-19 02:10:34 +01:00
Make -u idempotent
This commit is contained in:
parent
306cd99273
commit
cbf3f11cf8
3 changed files with 6 additions and 18 deletions
|
@ -102,12 +102,12 @@ pub fn build_app() -> Command<'static> {
|
|||
.short('u')
|
||||
.long("unrestricted")
|
||||
.overrides_with_all(&["ignore", "no-hidden"])
|
||||
.multiple_occurrences(true)
|
||||
.multiple_occurrences(true) // Allowed for historical reasons
|
||||
.hide_short_help(true)
|
||||
.help("Alias for '--no-ignore', and '--hidden' when given twice")
|
||||
.help("Alias for '--no-ignore', and '--hidden'")
|
||||
.long_help(
|
||||
"Alias for '--no-ignore'. Can be repeated. '-uu' is an alias for \
|
||||
'--no-ignore --hidden'.",
|
||||
"Perform a search with no filters applied. Unfilters ignored \
|
||||
files and hidden files.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
|
|
|
@ -256,7 +256,7 @@ fn construct_config(matches: clap::ArgMatches, pattern_regex: &str) -> Result<Co
|
|||
case_sensitive,
|
||||
search_full_path: matches.is_present("full-path"),
|
||||
ignore_hidden: !(matches.is_present("hidden")
|
||||
|| matches.occurrences_of("rg-alias-hidden-ignore") >= 2),
|
||||
|| matches.is_present("rg-alias-hidden-ignore")),
|
||||
read_fdignore: !(matches.is_present("no-ignore")
|
||||
|| matches.is_present("rg-alias-hidden-ignore")),
|
||||
read_vcsignore: !(matches.is_present("no-ignore")
|
||||
|
|
|
@ -656,18 +656,6 @@ fn test_no_ignore_aliases() {
|
|||
|
||||
te.assert_output(
|
||||
&["-u", "foo"],
|
||||
"./a.foo
|
||||
./fdignored.foo
|
||||
./gitignored.foo
|
||||
./one/b.foo
|
||||
./one/two/c.foo
|
||||
./one/two/C.Foo2
|
||||
./one/two/three/d.foo
|
||||
./one/two/three/directory_foo",
|
||||
);
|
||||
|
||||
te.assert_output(
|
||||
&["-uu", "foo"],
|
||||
"./.hidden.foo
|
||||
./a.foo
|
||||
./fdignored.foo
|
||||
|
@ -2039,7 +2027,7 @@ fn test_number_parsing_errors() {
|
|||
#[test_case("--no-ignore-vcs", &["--ignore-vcs"] ; "no-ignore-vcs")]
|
||||
#[test_case("--follow", &["--no-follow"] ; "follow")]
|
||||
#[test_case("--absolute-path", &["--relative-path"] ; "absolute-path")]
|
||||
#[test_case("-u", &["--ignore"] ; "u")]
|
||||
#[test_case("-u", &["--ignore", "--no-hidden"] ; "u")]
|
||||
#[test_case("-uu", &["--ignore", "--no-hidden"] ; "uu")]
|
||||
fn test_opposing(flag: &str, opposing_flags: &[&str]) {
|
||||
let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);
|
||||
|
|
Loading…
Reference in a new issue