mirror of
https://github.com/sharkdp/fd
synced 2024-09-04 15:53:20 +00:00
Rename --same-file-system
to --one-file-system
This commit is contained in:
parent
3e0325cc60
commit
94993ca6c2
28
README.md
28
README.md
|
@ -285,20 +285,20 @@ USAGE:
|
||||||
fd [FLAGS/OPTIONS] [<pattern>] [<path>...]
|
fd [FLAGS/OPTIONS] [<pattern>] [<path>...]
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-H, --hidden Search hidden files and directories
|
-H, --hidden Search hidden files and directories
|
||||||
-I, --no-ignore Do not respect .(git|fd)ignore files
|
-I, --no-ignore Do not respect .(git|fd)ignore files
|
||||||
--no-ignore-vcs Do not respect .gitignore files
|
--no-ignore-vcs Do not respect .gitignore files
|
||||||
-s, --case-sensitive Case-sensitive search (default: smart case)
|
-s, --case-sensitive Case-sensitive search (default: smart case)
|
||||||
-i, --ignore-case Case-insensitive search (default: smart case)
|
-i, --ignore-case Case-insensitive search (default: smart case)
|
||||||
-g, --glob Glob-based search (default: regular expression)
|
-g, --glob Glob-based search (default: regular expression)
|
||||||
-F, --fixed-strings Treat the pattern as a literal string
|
-F, --fixed-strings Treat the pattern as a literal string
|
||||||
-a, --absolute-path Show absolute instead of relative paths
|
-a, --absolute-path Show absolute instead of relative paths
|
||||||
-L, --follow Follow symbolic links
|
-L, --follow Follow symbolic links
|
||||||
--same-file-system Don't cross file system boundaries (only Unix/Windows)
|
--one-file-system Don't cross file system boundaries (only Unix/Windows)
|
||||||
-p, --full-path Search full path (default: file-/dirname only)
|
-p, --full-path Search full path (default: file-/dirname only)
|
||||||
-0, --print0 Separate results by the null character
|
-0, --print0 Separate results by the null character
|
||||||
-h, --help Prints help information
|
-h, --help Prints help information
|
||||||
-V, --version Prints version information
|
-V, --version Prints version information
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
-d, --max-depth <depth> Set maximum search depth (default: none)
|
-d, --max-depth <depth> Set maximum search depth (default: none)
|
||||||
|
|
|
@ -115,7 +115,7 @@ pub fn build_app() -> App<'static, 'static> {
|
||||||
.alias("dereference")
|
.alias("dereference")
|
||||||
.overrides_with("follow"),
|
.overrides_with("follow"),
|
||||||
)
|
)
|
||||||
.arg(arg("same-file-system").long("same-file-system"))
|
.arg(arg("one-file-system").long("one-file-system"))
|
||||||
.arg(
|
.arg(
|
||||||
arg("full-path")
|
arg("full-path")
|
||||||
.long("full-path")
|
.long("full-path")
|
||||||
|
@ -330,7 +330,7 @@ fn usage() -> HashMap<&'static str, Help> {
|
||||||
, "Follow symbolic links"
|
, "Follow symbolic links"
|
||||||
, "By default, fd does not descend into symlinked directories. Using this flag, symbolic \
|
, "By default, fd does not descend into symlinked directories. Using this flag, symbolic \
|
||||||
links are also traversed.");
|
links are also traversed.");
|
||||||
doc!(h, "same-file-system"
|
doc!(h, "one-file-system"
|
||||||
, "Don't cross file system boundaries (only Unix/Windows)"
|
, "Don't cross file system boundaries (only Unix/Windows)"
|
||||||
, "By default, fd will traverse the file system tree as far as other options dictate. \
|
, "By default, fd will traverse the file system tree as far as other options dictate. \
|
||||||
With this flag, fd ensures that it does not descend into a different file system than \
|
With this flag, fd ensures that it does not descend into a different file system than \
|
||||||
|
|
|
@ -29,7 +29,7 @@ pub struct FdOptions {
|
||||||
pub follow_links: bool,
|
pub follow_links: bool,
|
||||||
|
|
||||||
/// Whether to limit the search to starting file system or not.
|
/// Whether to limit the search to starting file system or not.
|
||||||
pub same_file_system: bool,
|
pub one_file_system: bool,
|
||||||
|
|
||||||
/// Whether elements of output should be separated by a null character
|
/// Whether elements of output should be separated by a null character
|
||||||
pub null_separator: bool,
|
pub null_separator: bool,
|
||||||
|
|
|
@ -208,7 +208,7 @@ fn main() {
|
||||||
|| matches.is_present("rg-alias-hidden-ignore")
|
|| matches.is_present("rg-alias-hidden-ignore")
|
||||||
|| matches.is_present("no-ignore-vcs")),
|
|| matches.is_present("no-ignore-vcs")),
|
||||||
follow_links: matches.is_present("follow"),
|
follow_links: matches.is_present("follow"),
|
||||||
same_file_system: matches.is_present("same-file-system"),
|
one_file_system: matches.is_present("one-file-system"),
|
||||||
null_separator: matches.is_present("null_separator"),
|
null_separator: matches.is_present("null_separator"),
|
||||||
max_depth: matches
|
max_depth: matches
|
||||||
.value_of("depth")
|
.value_of("depth")
|
||||||
|
|
|
@ -79,7 +79,7 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc<Regex>, config: Arc<FdOptions>) -
|
||||||
.overrides(overrides)
|
.overrides(overrides)
|
||||||
.follow_links(config.follow_links)
|
.follow_links(config.follow_links)
|
||||||
// Same file system is only supported on Unix and Windows platforms
|
// Same file system is only supported on Unix and Windows platforms
|
||||||
.same_file_system(config.same_file_system && (cfg!(unix) || cfg!(windows)))
|
.same_file_system(config.one_file_system && (cfg!(unix) || cfg!(windows)))
|
||||||
.max_depth(config.max_depth);
|
.max_depth(config.max_depth);
|
||||||
|
|
||||||
if config.read_fdignore {
|
if config.read_fdignore {
|
||||||
|
|
|
@ -555,7 +555,7 @@ fn test_follow() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// File system boundaries (--same-file-system)
|
// File system boundaries (--one-file-system)
|
||||||
// Limited to Unix because, to the best of my knowledge, there is no easy way to test a use case
|
// Limited to Unix because, to the best of my knowledge, there is no easy way to test a use case
|
||||||
// file systems mounted into the tree on Windows.
|
// file systems mounted into the tree on Windows.
|
||||||
// Not limiting depth causes massive delay under Darwin, see BurntSushi/ripgrep#1429
|
// Not limiting depth causes massive delay under Darwin, see BurntSushi/ripgrep#1429
|
||||||
|
@ -572,7 +572,7 @@ fn test_file_system_boundaries() {
|
||||||
);
|
);
|
||||||
te.assert_output(
|
te.assert_output(
|
||||||
&[
|
&[
|
||||||
"--same-file-system",
|
"--one-file-system",
|
||||||
"--full-path",
|
"--full-path",
|
||||||
"--max-depth",
|
"--max-depth",
|
||||||
"2",
|
"2",
|
||||||
|
|
Loading…
Reference in a new issue