nice: update to clap 4

This commit is contained in:
Terts Diepraam 2022-09-29 23:02:09 +02:00
parent 5faae817ba
commit 8b9971c54e
2 changed files with 4 additions and 5 deletions

View file

@ -15,7 +15,7 @@ edition = "2021"
path = "src/nice.rs"
[dependencies]
clap = { version = "3.2", features = ["wrap_help", "cargo"] }
clap = { version = "4.0", features = ["wrap_help", "cargo"] }
libc = "0.2.135"
nix = { version = "0.25", default-features = false }
uucore = { version=">=0.0.16", package="uucore", path="../../uucore" }

View file

@ -15,7 +15,7 @@ use std::ffi::CString;
use std::io::Error;
use std::ptr;
use clap::{crate_version, Arg, Command};
use clap::{crate_version, Arg, ArgAction, Command};
use uucore::{
error::{set_exit_code, UClapError, UResult, USimpleError, UUsageError},
format_usage,
@ -100,7 +100,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Ok(())
}
pub fn uu_app<'a>() -> Command<'a> {
pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.about(ABOUT)
.override_usage(format_usage(USAGE))
@ -112,12 +112,11 @@ pub fn uu_app<'a>() -> Command<'a> {
.short('n')
.long(options::ADJUSTMENT)
.help("add N to the niceness (default is 10)")
.takes_value(true)
.allow_hyphen_values(true),
)
.arg(
Arg::new(options::COMMAND)
.multiple_occurrences(true)
.action(ArgAction::Append)
.value_hint(clap::ValueHint::CommandName),
)
}