core: remove '' case for the update argument

This commit is contained in:
John Shin 2023-05-02 12:42:39 -07:00
parent 06d4603bea
commit 460d346069

View file

@ -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"),