mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
install: Adapt to modified backup mode determination
This commit is contained in:
parent
250bcaf7c5
commit
e07b4e9f59
1 changed files with 14 additions and 4 deletions
|
@ -308,15 +308,25 @@ fn behavior(matches: &ArgMatches) -> Result<Behavior, i32> {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let backup_mode = backup_control::determine_backup_mode(
|
||||||
|
matches.is_present(OPT_BACKUP_NO_ARG),
|
||||||
|
matches.is_present(OPT_BACKUP),
|
||||||
|
matches.value_of(OPT_BACKUP),
|
||||||
|
);
|
||||||
|
let backup_mode = match backup_mode {
|
||||||
|
Err(err) => {
|
||||||
|
show_usage_error!("{}", err);
|
||||||
|
return Err(1);
|
||||||
|
}
|
||||||
|
Ok(mode) => mode,
|
||||||
|
};
|
||||||
|
|
||||||
let target_dir = matches.value_of(OPT_TARGET_DIRECTORY).map(|d| d.to_owned());
|
let target_dir = matches.value_of(OPT_TARGET_DIRECTORY).map(|d| d.to_owned());
|
||||||
|
|
||||||
Ok(Behavior {
|
Ok(Behavior {
|
||||||
main_function,
|
main_function,
|
||||||
specified_mode,
|
specified_mode,
|
||||||
backup_mode: backup_control::determine_backup_mode(
|
backup_mode,
|
||||||
matches.is_present(OPT_BACKUP_NO_ARG) || matches.is_present(OPT_BACKUP),
|
|
||||||
matches.value_of(OPT_BACKUP),
|
|
||||||
),
|
|
||||||
suffix: backup_control::determine_backup_suffix(matches.value_of(OPT_SUFFIX)),
|
suffix: backup_control::determine_backup_suffix(matches.value_of(OPT_SUFFIX)),
|
||||||
owner: matches.value_of(OPT_OWNER).unwrap_or("").to_string(),
|
owner: matches.value_of(OPT_OWNER).unwrap_or("").to_string(),
|
||||||
group: matches.value_of(OPT_GROUP).unwrap_or("").to_string(),
|
group: matches.value_of(OPT_GROUP).unwrap_or("").to_string(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue