mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 17:58:06 +00:00
Merge pull request #1631 from sylvestre/clap-version
Remove version mgmt, it is done by clap
This commit is contained in:
commit
6870d81b33
2 changed files with 0 additions and 27 deletions
|
@ -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<String> = matches
|
||||
.values_of("paths")
|
||||
|
|
|
@ -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<String> = matches
|
||||
.values_of(OPT_PATHS)
|
||||
.map(|v| v.map(ToString::to_string).collect())
|
||||
|
|
Loading…
Reference in a new issue