mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-19 02:10:34 +01:00
parent
e46d402ed1
commit
4419401b6c
3 changed files with 331 additions and 343 deletions
|
@ -719,10 +719,10 @@ pub fn build_app() -> Command<'static> {
|
||||||
.long("strip-cwd-prefix")
|
.long("strip-cwd-prefix")
|
||||||
.conflicts_with_all(&["path", "search-path"])
|
.conflicts_with_all(&["path", "search-path"])
|
||||||
.hide_short_help(true)
|
.hide_short_help(true)
|
||||||
.help("strip './' prefix from non-tty outputs")
|
.help("strip './' prefix from -0/--print0 output")
|
||||||
.long_help(
|
.long_help(
|
||||||
"By default, relative paths are prefixed with './' when the output goes to a non \
|
"By default, relative paths are prefixed with './' when -0/--print0 is given, to \
|
||||||
interactive terminal (TTY). Use this flag to disable this behaviour."
|
make them safer for use with xargs. Use this flag to disable this behaviour."
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -385,7 +385,7 @@ fn construct_config(matches: clap::ArgMatches, pattern_regex: &str) -> Result<Co
|
||||||
}),
|
}),
|
||||||
strip_cwd_prefix: (!matches.is_present("path")
|
strip_cwd_prefix: (!matches.is_present("path")
|
||||||
&& !matches.is_present("search-path")
|
&& !matches.is_present("search-path")
|
||||||
&& (interactive_terminal || matches.is_present("strip-cwd-prefix"))),
|
&& (!matches.is_present("null_separator") || matches.is_present("strip-cwd-prefix"))),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
666
tests/tests.rs
666
tests/tests.rs
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue