1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 19:56:17 +00:00

groups: update to clap 4

This commit is contained in:
Terts Diepraam 2022-09-29 18:26:30 +02:00
parent 6ee19a42a4
commit 6df2187397
2 changed files with 4 additions and 5 deletions

View file

@ -15,7 +15,7 @@ edition = "2021"
path = "src/groups.rs" path = "src/groups.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", features=["entries", "process"] } uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["entries", "process"] }
[[bin]] [[bin]]

View file

@ -26,7 +26,7 @@ use uucore::{
format_usage, format_usage,
}; };
use clap::{crate_version, Arg, Command}; use clap::{crate_version, Arg, ArgAction, Command};
mod options { mod options {
pub const USERS: &str = "USERNAME"; pub const USERS: &str = "USERNAME";
@ -102,7 +102,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)
@ -110,8 +110,7 @@ pub fn uu_app<'a>() -> Command<'a> {
.infer_long_args(true) .infer_long_args(true)
.arg( .arg(
Arg::new(options::USERS) Arg::new(options::USERS)
.multiple_occurrences(true) .action(ArgAction::Append)
.takes_value(true)
.value_name(options::USERS) .value_name(options::USERS)
.value_hint(clap::ValueHint::Username), .value_hint(clap::ValueHint::Username),
) )