mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
uu_install: add inconsistent args check
This commit is contained in:
parent
b22d2470ac
commit
61ad2c17b0
1 changed files with 14 additions and 3 deletions
|
@ -370,6 +370,17 @@ fn behavior(matches: &ArgMatches) -> UResult<Behavior> {
|
||||||
let backup_mode = backup_control::determine_backup_mode(matches)?;
|
let backup_mode = backup_control::determine_backup_mode(matches)?;
|
||||||
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());
|
||||||
|
|
||||||
|
let preserve_timestamps = matches.is_present(OPT_PRESERVE_TIMESTAMPS);
|
||||||
|
let compare = matches.is_present(OPT_COMPARE);
|
||||||
|
let strip = matches.is_present(OPT_STRIP);
|
||||||
|
if preserve_timestamps && compare {
|
||||||
|
show_error!("Options --compare and --preserve-timestamps are mutually exclusive");
|
||||||
|
return Err(1.into());
|
||||||
|
}
|
||||||
|
if compare && strip {
|
||||||
|
show_error!("Options --compare and --strip are mutually exclusive");
|
||||||
|
return Err(1.into());
|
||||||
|
}
|
||||||
Ok(Behavior {
|
Ok(Behavior {
|
||||||
main_function,
|
main_function,
|
||||||
specified_mode,
|
specified_mode,
|
||||||
|
@ -378,9 +389,9 @@ fn behavior(matches: &ArgMatches) -> UResult<Behavior> {
|
||||||
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(),
|
||||||
verbose: matches.is_present(OPT_VERBOSE),
|
verbose: matches.is_present(OPT_VERBOSE),
|
||||||
preserve_timestamps: matches.is_present(OPT_PRESERVE_TIMESTAMPS),
|
preserve_timestamps,
|
||||||
compare: matches.is_present(OPT_COMPARE),
|
compare,
|
||||||
strip: matches.is_present(OPT_STRIP),
|
strip,
|
||||||
strip_program: String::from(
|
strip_program: String::from(
|
||||||
matches
|
matches
|
||||||
.value_of(OPT_STRIP_PROGRAM)
|
.value_of(OPT_STRIP_PROGRAM)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue