mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +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_OK: i32 = 0;
|
||||||
static EXIT_ERR: i32 = 1;
|
static EXIT_ERR: i32 = 1;
|
||||||
|
|
||||||
/// Prints the version
|
|
||||||
fn print_version() {
|
|
||||||
println!("{} {}", executable!(), VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_usage() -> String {
|
fn get_usage() -> String {
|
||||||
format!(
|
format!(
|
||||||
"{0} [OPTION]... [-T] SOURCE DEST
|
"{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_TARGET_DIRECTORY: &str = "target-directory";
|
||||||
static OPT_UPDATE: &str = "update";
|
static OPT_UPDATE: &str = "update";
|
||||||
static OPT_VERBOSE: &str = "verbose";
|
static OPT_VERBOSE: &str = "verbose";
|
||||||
static OPT_VERSION: &str = "version";
|
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
static PRESERVABLE_ATTRIBUTES: &[&str] = &[
|
static PRESERVABLE_ATTRIBUTES: &[&str] = &[
|
||||||
|
@ -325,10 +319,6 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
.long(OPT_NO_TARGET_DIRECTORY)
|
.long(OPT_NO_TARGET_DIRECTORY)
|
||||||
.conflicts_with(OPT_TARGET_DIRECTORY)
|
.conflicts_with(OPT_TARGET_DIRECTORY)
|
||||||
.help("Treat DEST as a regular file and not a 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)
|
.arg(Arg::with_name(OPT_INTERACTIVE)
|
||||||
.short("i")
|
.short("i")
|
||||||
.long(OPT_INTERACTIVE)
|
.long(OPT_INTERACTIVE)
|
||||||
|
@ -472,11 +462,6 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
.multiple(true))
|
.multiple(true))
|
||||||
.get_matches_from(args);
|
.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 options = crash_if_err!(EXIT_ERR, Options::from_matches(&matches));
|
||||||
let paths: Vec<String> = matches
|
let paths: Vec<String> = matches
|
||||||
.values_of("paths")
|
.values_of("paths")
|
||||||
|
|
|
@ -106,7 +106,6 @@ static OPT_SYNC: &str = "sync";
|
||||||
static OPT_TYPE: &str = "type";
|
static OPT_TYPE: &str = "type";
|
||||||
static OPT_PRINT_TYPE: &str = "print-type";
|
static OPT_PRINT_TYPE: &str = "print-type";
|
||||||
static OPT_EXCLUDE_TYPE: &str = "exclude-type";
|
static OPT_EXCLUDE_TYPE: &str = "exclude-type";
|
||||||
static OPT_VERSION: &str = "version";
|
|
||||||
|
|
||||||
static MOUNT_OPT_BIND: &str = "bind";
|
static MOUNT_OPT_BIND: &str = "bind";
|
||||||
|
|
||||||
|
@ -854,21 +853,10 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
.use_delimiter(true)
|
.use_delimiter(true)
|
||||||
.help("limit listing to file systems not of type TYPE"),
|
.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))
|
.arg(Arg::with_name(OPT_PATHS).multiple(true))
|
||||||
.help("Filesystem(s) to list")
|
.help("Filesystem(s) to list")
|
||||||
.get_matches_from(args);
|
.get_matches_from(args);
|
||||||
|
|
||||||
if matches.is_present(OPT_VERSION) {
|
|
||||||
println!("{} {}", executable!(), VERSION);
|
|
||||||
return EXIT_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
let paths: Vec<String> = matches
|
let paths: Vec<String> = matches
|
||||||
.values_of(OPT_PATHS)
|
.values_of(OPT_PATHS)
|
||||||
.map(|v| v.map(ToString::to_string).collect())
|
.map(|v| v.map(ToString::to_string).collect())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue