mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07: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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user