1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 04:27:45 +00:00

sleep: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 14:45:34 +01:00
parent 793e540323
commit d0a52c95e6
2 changed files with 5 additions and 6 deletions

View file

@ -15,7 +15,7 @@ edition = "2018"
path = "src/sleep.rs"
[dependencies]
clap = { version = "2.33", features = ["wrap_help"] }
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }

View file

@ -35,7 +35,7 @@ fn usage() -> String {
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage();
let matches = uu_app().usage(&usage[..]).get_matches_from(args);
let matches = uu_app().override_usage(&usage[..]).get_matches_from(args);
if let Some(values) = matches.values_of(options::NUMBER) {
let numbers = values.collect();
@ -45,18 +45,17 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Ok(())
}
pub fn uu_app() -> App<'static, 'static> {
pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name())
.version(crate_version!())
.about(ABOUT)
.after_help(LONG_HELP)
.arg(
Arg::with_name(options::NUMBER)
.long(options::NUMBER)
Arg::new(options::NUMBER)
.help("pause for NUMBER seconds")
.value_name(options::NUMBER)
.index(1)
.multiple(true)
.multiple_occurrences(true)
.required(true),
)
}