mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 23:02:38 +00:00
core: remove '' case for the update argument
This commit is contained in:
parent
06d4603bea
commit
460d346069
1 changed files with 2 additions and 2 deletions
|
@ -73,7 +73,7 @@ pub mod arguments {
|
||||||
clap::Arg::new(OPT_UPDATE)
|
clap::Arg::new(OPT_UPDATE)
|
||||||
.long("update")
|
.long("update")
|
||||||
.help("move only when the SOURCE file is newer than the destination file or when the destination file is missing")
|
.help("move only when the SOURCE file is newer than the destination file or when the destination file is missing")
|
||||||
.value_parser(["", "none", "all", "older"])
|
.value_parser(["none", "all", "older"])
|
||||||
.num_args(0..=1)
|
.num_args(0..=1)
|
||||||
.default_missing_value("older")
|
.default_missing_value("older")
|
||||||
.require_equals(true)
|
.require_equals(true)
|
||||||
|
@ -125,7 +125,7 @@ pub fn determine_update_mode(matches: &ArgMatches) -> UpdateMode {
|
||||||
if matches.contains_id(arguments::OPT_UPDATE) {
|
if matches.contains_id(arguments::OPT_UPDATE) {
|
||||||
if let Some(mode) = matches.get_one::<String>(arguments::OPT_UPDATE) {
|
if let Some(mode) = matches.get_one::<String>(arguments::OPT_UPDATE) {
|
||||||
match mode.as_str() {
|
match mode.as_str() {
|
||||||
"all" | "" => UpdateMode::ReplaceAll,
|
"all" => UpdateMode::ReplaceAll,
|
||||||
"none" => UpdateMode::ReplaceNone,
|
"none" => UpdateMode::ReplaceNone,
|
||||||
"older" => UpdateMode::ReplaceIfOlder,
|
"older" => UpdateMode::ReplaceIfOlder,
|
||||||
_ => unreachable!("other args restricted by clap"),
|
_ => unreachable!("other args restricted by clap"),
|
||||||
|
|
Loading…
Reference in a new issue