mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-02 14:07:46 +00:00
install: Fix argument parsing for '--backup'
The '--backup' option would previously accept arguments separated from the option either by a space or an equals sign. The GNU implementation strictly requires an "equals" for argument separation. As the argument to '--backup' is optional, the equals sign mustn't be ommited as otherwise there is no way to tell a file argument apart from an argument that's meant for the '--backup' option. This ensures that if '--backup' is present it either has no further associated arguments (i.e. fallback to the default), or the arguments are separated by an equals sign.
This commit is contained in:
parent
211af9a3ea
commit
3155cd510f
1 changed files with 3 additions and 0 deletions
|
@ -106,6 +106,9 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
Arg::with_name(OPT_BACKUP)
|
||||
.long(OPT_BACKUP)
|
||||
.help("(unimplemented) make a backup of each existing destination file")
|
||||
.takes_value(true)
|
||||
.require_equals(true)
|
||||
.min_values(0)
|
||||
.value_name("CONTROL")
|
||||
)
|
||||
.arg(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue