mirror of
https://github.com/sharkdp/fd.git
synced 2024-09-28 13:01:30 +02:00
Add aliases for --one-file-system
The functionality provided by `--one-file-system` is called `-mount`/`-xdev` under `find`, so provide those aliases as a compromise.
This commit is contained in:
parent
dea1fbe722
commit
6f7d10870c
@ -286,9 +286,14 @@ pub fn build_app() -> App<'static, 'static> {
|
|||||||
|
|
||||||
// Make `--one-file-system` available only on Unix and Windows platforms, as per the
|
// Make `--one-file-system` available only on Unix and Windows platforms, as per the
|
||||||
// restrictions on the corresponding option in the `ignore` crate.
|
// restrictions on the corresponding option in the `ignore` crate.
|
||||||
|
// Provide aliases `mount` and `xdev` for people coming from `find`.
|
||||||
// It's not pretty, but I'm unaware of a way to make just part of a builder chain conditional
|
// It's not pretty, but I'm unaware of a way to make just part of a builder chain conditional
|
||||||
if cfg!(unix) || cfg!(windows) {
|
if cfg!(unix) || cfg!(windows) {
|
||||||
app.arg(arg("one-file-system").long("one-file-system"))
|
app.arg(
|
||||||
|
arg("one-file-system")
|
||||||
|
.long("one-file-system")
|
||||||
|
.aliases(&["mount", "xdev"]),
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
app
|
app
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user