mirror of
https://github.com/sharkdp/fd.git
synced 2024-09-28 13:01:30 +02:00
replace -N option with specifying '.' path
This commit is contained in:
parent
08d913f167
commit
953f586f26
@ -12,8 +12,6 @@
|
|||||||
|
|
||||||
- Add new `--no-ignore-parent` flag, see #787 (@will459)
|
- Add new `--no-ignore-parent` flag, see #787 (@will459)
|
||||||
|
|
||||||
- Add new `-N, --no-strip` flag, see #760 (@jcaplan)
|
|
||||||
|
|
||||||
## Bugfixes
|
## Bugfixes
|
||||||
|
|
||||||
- Set default path separator to `/` in MSYS, see #537 and #730 (@aswild)
|
- Set default path separator to `/` in MSYS, see #537 and #730 (@aswild)
|
||||||
|
11
src/app.rs
11
src/app.rs
@ -615,17 +615,6 @@ pub fn build_app() -> App<'static, 'static> {
|
|||||||
argument. Changes the usage to `fd [FLAGS/OPTIONS] --search-path <path> \
|
argument. Changes the usage to `fd [FLAGS/OPTIONS] --search-path <path> \
|
||||||
--search-path <path2> [<pattern>]`",
|
--search-path <path2> [<pattern>]`",
|
||||||
),
|
),
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::with_name("no-strip")
|
|
||||||
.long("no-strip")
|
|
||||||
.short("N")
|
|
||||||
.conflicts_with_all(&["absolute-path", "list-details"])
|
|
||||||
.help("Show all non-absolute paths with './' prefix")
|
|
||||||
.long_help(
|
|
||||||
"Show all non-absolute paths with './' prefix. This flag only affects \
|
|
||||||
the output when no search path is provided.")
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if cfg!(unix) {
|
if cfg!(unix) {
|
||||||
|
@ -375,8 +375,8 @@ fn construct_config(matches: clap::ArgMatches, pattern_regex: &str) -> Result<Co
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
no_strip: matches.is_present("no-strip"),
|
no_strip: matches.is_present("path") || matches.is_present("search-path"),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn extract_command(
|
fn extract_command(
|
||||||
|
@ -1907,7 +1907,7 @@ fn test_error_if_hidden_not_set_and_pattern_starts_with_dot() {
|
|||||||
fn test_no_strip() {
|
fn test_no_strip() {
|
||||||
let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);
|
let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);
|
||||||
te.assert_output(
|
te.assert_output(
|
||||||
&["--no-strip"],
|
&[".", "."],
|
||||||
"./a.foo
|
"./a.foo
|
||||||
./e1 e2
|
./e1 e2
|
||||||
./one
|
./one
|
||||||
@ -1922,19 +1922,17 @@ fn test_no_strip() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
te.assert_output(
|
te.assert_output(
|
||||||
&["--no-strip", "foo", "./one"],
|
&["--search-path=."],
|
||||||
"./one/b.foo
|
"./a.foo
|
||||||
|
./e1 e2
|
||||||
|
./one
|
||||||
|
./one/b.foo
|
||||||
|
./one/two
|
||||||
./one/two/c.foo
|
./one/two/c.foo
|
||||||
./one/two/C.Foo2
|
./one/two/C.Foo2
|
||||||
|
./one/two/three
|
||||||
./one/two/three/d.foo
|
./one/two/three/d.foo
|
||||||
./one/two/three/directory_foo",
|
./one/two/three/directory_foo
|
||||||
);
|
./symlink",
|
||||||
te.assert_output(
|
|
||||||
&["--no-strip", "foo", "one"],
|
|
||||||
"one/b.foo
|
|
||||||
one/two/c.foo
|
|
||||||
one/two/C.Foo2
|
|
||||||
one/two/three/d.foo
|
|
||||||
one/two/three/directory_foo",
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user