1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #3900 from cakebaker/rm_fix_indentation

rm: fix indentation within uu_app()
This commit is contained in:
Sylvestre Ledru 2022-09-04 16:06:05 +02:00 committed by GitHub
commit 1054c5c365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -150,66 +150,74 @@ pub fn uu_app<'a>() -> Command<'a> {
.infer_long_args(true) .infer_long_args(true)
.arg( .arg(
Arg::new(OPT_FORCE) Arg::new(OPT_FORCE)
.short('f') .short('f')
.long(OPT_FORCE) .long(OPT_FORCE)
.multiple_occurrences(true) .multiple_occurrences(true)
.help("ignore nonexistent files and arguments, never prompt") .help("ignore nonexistent files and arguments, never prompt"),
) )
.arg( .arg(
Arg::new(OPT_PROMPT) Arg::new(OPT_PROMPT)
.short('i') .short('i')
.help("prompt before every removal") .help("prompt before every removal"),
)
.arg(
Arg::new(OPT_PROMPT_MORE)
.short('I')
.help("prompt once before removing more than three files, or when removing recursively. Less intrusive than -i, while still giving some protection against most mistakes")
) )
.arg(Arg::new(OPT_PROMPT_MORE).short('I').help(
"prompt once before removing more than three files, or when removing recursively. \
Less intrusive than -i, while still giving some protection against most mistakes",
))
.arg( .arg(
Arg::new(OPT_INTERACTIVE) Arg::new(OPT_INTERACTIVE)
.long(OPT_INTERACTIVE) .long(OPT_INTERACTIVE)
.help("prompt according to WHEN: never, once (-I), or always (-i). Without WHEN, prompts always") .help(
.value_name("WHEN") "prompt according to WHEN: never, once (-I), or always (-i). Without WHEN, \
.takes_value(true) prompts always",
)
.value_name("WHEN")
.takes_value(true),
) )
.arg( .arg(
Arg::new(OPT_ONE_FILE_SYSTEM) Arg::new(OPT_ONE_FILE_SYSTEM)
.long(OPT_ONE_FILE_SYSTEM) .long(OPT_ONE_FILE_SYSTEM)
.help("when removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command line argument (NOT IMPLEMENTED)") .help(
"when removing a hierarchy recursively, skip any directory that is on a file \
system different from that of the corresponding command line argument (NOT \
IMPLEMENTED)",
),
) )
.arg( .arg(
Arg::new(OPT_NO_PRESERVE_ROOT) Arg::new(OPT_NO_PRESERVE_ROOT)
.long(OPT_NO_PRESERVE_ROOT) .long(OPT_NO_PRESERVE_ROOT)
.help("do not treat '/' specially") .help("do not treat '/' specially"),
) )
.arg( .arg(
Arg::new(OPT_PRESERVE_ROOT) Arg::new(OPT_PRESERVE_ROOT)
.long(OPT_PRESERVE_ROOT) .long(OPT_PRESERVE_ROOT)
.help("do not remove '/' (default)") .help("do not remove '/' (default)"),
) )
.arg( .arg(
Arg::new(OPT_RECURSIVE).short('r') Arg::new(OPT_RECURSIVE)
.multiple_occurrences(true) .short('r')
.long(OPT_RECURSIVE) .multiple_occurrences(true)
.help("remove directories and their contents recursively") .long(OPT_RECURSIVE)
.help("remove directories and their contents recursively"),
) )
.arg( .arg(
// To mimic GNU's behavior we also want the '-R' flag. However, using clap's // To mimic GNU's behavior we also want the '-R' flag. However, using clap's
// alias method 'visible_alias("R")' would result in a long '--R' flag. // alias method 'visible_alias("R")' would result in a long '--R' flag.
Arg::new(OPT_RECURSIVE_R).short('R') Arg::new(OPT_RECURSIVE_R)
.help("Equivalent to -r") .short('R')
.help("Equivalent to -r"),
) )
.arg( .arg(
Arg::new(OPT_DIR) Arg::new(OPT_DIR)
.short('d') .short('d')
.long(OPT_DIR) .long(OPT_DIR)
.help("remove empty directories") .help("remove empty directories"),
) )
.arg( .arg(
Arg::new(OPT_VERBOSE) Arg::new(OPT_VERBOSE)
.short('v') .short('v')
.long(OPT_VERBOSE) .long(OPT_VERBOSE)
.help("explain what is being done") .help("explain what is being done"),
) )
// From the GNU source code: // From the GNU source code:
// This is solely for testing. // This is solely for testing.
@ -221,16 +229,16 @@ pub fn uu_app<'a>() -> Command<'a> {
// hyphens. Therefore it supports 3 leading hyphens. // hyphens. Therefore it supports 3 leading hyphens.
.arg( .arg(
Arg::new(PRESUME_INPUT_TTY) Arg::new(PRESUME_INPUT_TTY)
.long(PRESUME_INPUT_TTY) .long(PRESUME_INPUT_TTY)
.alias(PRESUME_INPUT_TTY) .alias(PRESUME_INPUT_TTY)
.hide(true) .hide(true),
) )
.arg( .arg(
Arg::new(ARG_FILES) Arg::new(ARG_FILES)
.multiple_occurrences(true) .multiple_occurrences(true)
.takes_value(true) .takes_value(true)
.min_values(1) .min_values(1)
.value_hint(clap::ValueHint::AnyPath) .value_hint(clap::ValueHint::AnyPath),
) )
} }