mirror of
https://github.com/uutils/coreutils
synced 2024-11-17 02:08:09 +00:00
mv: Adapt for new backup_control utilities
This commit is contained in:
parent
a783d05101
commit
9d94307880
1 changed files with 9 additions and 2 deletions
|
@ -86,9 +86,17 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
|
|
||||||
let overwrite_mode = determine_overwrite_mode(&matches);
|
let overwrite_mode = determine_overwrite_mode(&matches);
|
||||||
let backup_mode = backup_control::determine_backup_mode(
|
let backup_mode = backup_control::determine_backup_mode(
|
||||||
matches.is_present(OPT_BACKUP_NO_ARG) || matches.is_present(OPT_BACKUP),
|
matches.is_present(OPT_BACKUP_NO_ARG),
|
||||||
|
matches.is_present(OPT_BACKUP),
|
||||||
matches.value_of(OPT_BACKUP),
|
matches.value_of(OPT_BACKUP),
|
||||||
);
|
);
|
||||||
|
let backup_mode = match backup_mode {
|
||||||
|
Err(err) => {
|
||||||
|
show_usage_error!("{}", err);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
Ok(mode) => mode,
|
||||||
|
};
|
||||||
|
|
||||||
if overwrite_mode == OverwriteMode::NoClobber && backup_mode != BackupMode::NoBackup {
|
if overwrite_mode == OverwriteMode::NoClobber && backup_mode != BackupMode::NoBackup {
|
||||||
show_usage_error!("options --backup and --no-clobber are mutually exclusive");
|
show_usage_error!("options --backup and --no-clobber are mutually exclusive");
|
||||||
|
@ -135,7 +143,6 @@ pub fn uu_app() -> App<'static, 'static> {
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.require_equals(true)
|
.require_equals(true)
|
||||||
.min_values(0)
|
.min_values(0)
|
||||||
.possible_values(backup_control::BACKUP_CONTROL_VALUES)
|
|
||||||
.value_name("CONTROL")
|
.value_name("CONTROL")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
|
Loading…
Reference in a new issue