From df41fed6402bd71eb6a2557bace8750513556f58 Mon Sep 17 00:00:00 2001 From: Andreas Hartmann Date: Wed, 23 Jun 2021 16:33:52 +0200 Subject: [PATCH] install: Mark '-S', '-b' and '--backup' as implemented Removes the "unimplemented" notice from the respective help texts. Stop printing errors if the options are supplied via CLI. --- src/uu/install/src/install.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/uu/install/src/install.rs b/src/uu/install/src/install.rs index 451545e62..d25fc47bc 100644 --- a/src/uu/install/src/install.rs +++ b/src/uu/install/src/install.rs @@ -107,7 +107,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 { .arg( Arg::with_name(OPT_BACKUP) .long(OPT_BACKUP) - .help("(unimplemented) make a backup of each existing destination file") + .help("make a backup of each existing destination file") .takes_value(true) .require_equals(true) .min_values(0) @@ -117,7 +117,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 { // TODO implement flag Arg::with_name(OPT_BACKUP_NO_ARG) .short("b") - .help("(unimplemented) like --backup but does not accept an argument") + .help("like --backup but does not accept an argument") ) .arg( Arg::with_name(OPT_IGNORED) @@ -190,7 +190,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 { Arg::with_name(OPT_SUFFIX) .short("S") .long(OPT_SUFFIX) - .help("(unimplemented) override the usual backup suffix") + .help("override the usual backup suffix") .value_name("SUFFIX") .takes_value(true) .min_values(1) @@ -268,14 +268,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 { /// /// fn check_unimplemented<'a>(matches: &ArgMatches) -> Result<(), &'a str> { - if matches.is_present(OPT_BACKUP) { - Err("--backup") - } else if matches.is_present(OPT_BACKUP_2) { - Err("-b") - } else if matches.is_present(OPT_BACKUP_NO_ARG) { - } else if matches.is_present(OPT_SUFFIX) { - Err("--suffix, -S") - } else if matches.is_present(OPT_NO_TARGET_DIRECTORY) { + if matches.is_present(OPT_NO_TARGET_DIRECTORY) { Err("--no-target-directory, -T") } else if matches.is_present(OPT_PRESERVE_CONTEXT) { Err("--preserve-context, -P")