mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-05 07:27:46 +00:00
test: clap 3
This commit is contained in:
parent
3cac8a631f
commit
0ff1984471
2 changed files with 5 additions and 7 deletions
|
@ -15,7 +15,7 @@ edition = "2018"
|
||||||
path = "src/test.rs"
|
path = "src/test.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "2.33", features = ["wrap_help"] }
|
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.42"
|
libc = "0.2.42"
|
||||||
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
|
||||||
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
||||||
|
|
|
@ -86,10 +86,10 @@ NOTE: your shell may have its own version of test and/or [, which usually supers
|
||||||
the version described here. Please refer to your shell's documentation
|
the version described here. Please refer to your shell's documentation
|
||||||
for details about the options it supports.";
|
for details about the options it supports.";
|
||||||
|
|
||||||
pub fn uu_app() -> App<'static, 'static> {
|
pub fn uu_app<'a>() -> App<'a> {
|
||||||
App::new(uucore::util_name())
|
App::new(uucore::util_name())
|
||||||
.setting(AppSettings::DisableHelpFlags)
|
.setting(AppSettings::DisableHelpFlag)
|
||||||
.setting(AppSettings::DisableVersion)
|
.setting(AppSettings::DisableVersionFlag)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[uucore_procs::gen_uumain]
|
#[uucore_procs::gen_uumain]
|
||||||
|
@ -104,12 +104,10 @@ pub fn uumain(mut args: impl uucore::Args) -> UResult<()> {
|
||||||
// Let clap pretty-print help and version
|
// Let clap pretty-print help and version
|
||||||
App::new(binary_name)
|
App::new(binary_name)
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.usage(USAGE)
|
.override_usage(USAGE)
|
||||||
.after_help(AFTER_HELP)
|
.after_help(AFTER_HELP)
|
||||||
// Disable printing of -h and -v as valid alternatives for --help and --version,
|
// Disable printing of -h and -v as valid alternatives for --help and --version,
|
||||||
// since we don't recognize -h and -v as help/version flags.
|
// since we don't recognize -h and -v as help/version flags.
|
||||||
.setting(AppSettings::NeedsLongHelp)
|
|
||||||
.setting(AppSettings::NeedsLongVersion)
|
|
||||||
.get_matches_from(std::iter::once(program).chain(args.into_iter()));
|
.get_matches_from(std::iter::once(program).chain(args.into_iter()));
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue