1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 13:37:48 +00:00

sleep: update to clap 4

This commit is contained in:
Terts Diepraam 2022-09-30 16:42:49 +02:00
parent 4d52449667
commit 6a98c4c7d0
2 changed files with 4 additions and 5 deletions

View file

@ -15,7 +15,7 @@ edition = "2021"
path = "src/sleep.rs" path = "src/sleep.rs"
[dependencies] [dependencies]
clap = { version = "3.2", features = ["wrap_help", "cargo"] } clap = { version = "4.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.16", package="uucore", path="../../uucore" } uucore = { version=">=0.0.16", package="uucore", path="../../uucore" }
[[bin]] [[bin]]

View file

@ -13,7 +13,7 @@ use uucore::{
format_usage, format_usage,
}; };
use clap::{crate_version, Arg, Command}; use clap::{crate_version, Arg, ArgAction, Command};
static ABOUT: &str = "Pause for NUMBER seconds."; static ABOUT: &str = "Pause for NUMBER seconds.";
const USAGE: &str = "\ const USAGE: &str = "\
@ -41,7 +41,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Ok(()) Ok(())
} }
pub fn uu_app<'a>() -> Command<'a> { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
@ -52,8 +52,7 @@ pub fn uu_app<'a>() -> Command<'a> {
Arg::new(options::NUMBER) Arg::new(options::NUMBER)
.help("pause for NUMBER seconds") .help("pause for NUMBER seconds")
.value_name(options::NUMBER) .value_name(options::NUMBER)
.index(1) .action(ArgAction::Append)
.multiple_occurrences(true)
.required(true), .required(true),
) )
} }