From 5c8e47a4d1e67d7132e7c359a3a75860baf0d2d8 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 8 Nov 2020 17:55:06 +0100 Subject: [PATCH] Remove version mgmt, it is done by clap --- src/uu/cp/src/cp.rs | 15 --------------- src/uu/df/src/df.rs | 12 ------------ 2 files changed, 27 deletions(-) diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index 3c04a55e5..85759033a 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -231,11 +231,6 @@ static ABOUT: &str = "Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY."; static EXIT_OK: i32 = 0; static EXIT_ERR: i32 = 1; -/// Prints the version -fn print_version() { - println!("{} {}", executable!(), VERSION); -} - fn get_usage() -> String { format!( "{0} [OPTION]... [-T] SOURCE DEST @@ -277,7 +272,6 @@ static OPT_SYMBOLIC_LINK: &str = "symbolic-link"; static OPT_TARGET_DIRECTORY: &str = "target-directory"; static OPT_UPDATE: &str = "update"; static OPT_VERBOSE: &str = "verbose"; -static OPT_VERSION: &str = "version"; #[cfg(unix)] static PRESERVABLE_ATTRIBUTES: &[&str] = &[ @@ -325,10 +319,6 @@ pub fn uumain(args: impl uucore::Args) -> i32 { .long(OPT_NO_TARGET_DIRECTORY) .conflicts_with(OPT_TARGET_DIRECTORY) .help("Treat DEST as a regular file and not a directory")) - .arg(Arg::with_name(OPT_VERSION) - .short("V") - .long(OPT_VERSION) - .help("output version information and exit")) .arg(Arg::with_name(OPT_INTERACTIVE) .short("i") .long(OPT_INTERACTIVE) @@ -472,11 +462,6 @@ pub fn uumain(args: impl uucore::Args) -> i32 { .multiple(true)) .get_matches_from(args); - if matches.is_present(OPT_VERSION) { - print_version(); - return EXIT_OK; - } - let options = crash_if_err!(EXIT_ERR, Options::from_matches(&matches)); let paths: Vec = matches .values_of("paths") diff --git a/src/uu/df/src/df.rs b/src/uu/df/src/df.rs index d1541866d..36edc4ff2 100644 --- a/src/uu/df/src/df.rs +++ b/src/uu/df/src/df.rs @@ -106,7 +106,6 @@ static OPT_SYNC: &str = "sync"; static OPT_TYPE: &str = "type"; static OPT_PRINT_TYPE: &str = "print-type"; static OPT_EXCLUDE_TYPE: &str = "exclude-type"; -static OPT_VERSION: &str = "version"; static MOUNT_OPT_BIND: &str = "bind"; @@ -854,21 +853,10 @@ pub fn uumain(args: impl uucore::Args) -> i32 { .use_delimiter(true) .help("limit listing to file systems not of type TYPE"), ) - .arg( - Arg::with_name(OPT_VERSION) - .short("v") - .long("version") - .help("output version information and exit"), - ) .arg(Arg::with_name(OPT_PATHS).multiple(true)) .help("Filesystem(s) to list") .get_matches_from(args); - if matches.is_present(OPT_VERSION) { - println!("{} {}", executable!(), VERSION); - return EXIT_OK; - } - let paths: Vec = matches .values_of(OPT_PATHS) .map(|v| v.map(ToString::to_string).collect())