mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-17 12:16:17 +00:00
nice: update to clap 4
This commit is contained in:
parent
5faae817ba
commit
8b9971c54e
2 changed files with 4 additions and 5 deletions
|
@ -15,7 +15,7 @@ edition = "2021"
|
||||||
path = "src/nice.rs"
|
path = "src/nice.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.2", features = ["wrap_help", "cargo"] }
|
clap = { version = "4.0", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.135"
|
libc = "0.2.135"
|
||||||
nix = { version = "0.25", default-features = false }
|
nix = { version = "0.25", default-features = false }
|
||||||
uucore = { version=">=0.0.16", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.16", package="uucore", path="../../uucore" }
|
||||||
|
|
|
@ -15,7 +15,7 @@ use std::ffi::CString;
|
||||||
use std::io::Error;
|
use std::io::Error;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
||||||
use clap::{crate_version, Arg, Command};
|
use clap::{crate_version, Arg, ArgAction, Command};
|
||||||
use uucore::{
|
use uucore::{
|
||||||
error::{set_exit_code, UClapError, UResult, USimpleError, UUsageError},
|
error::{set_exit_code, UClapError, UResult, USimpleError, UUsageError},
|
||||||
format_usage,
|
format_usage,
|
||||||
|
@ -100,7 +100,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())
|
||||||
.about(ABOUT)
|
.about(ABOUT)
|
||||||
.override_usage(format_usage(USAGE))
|
.override_usage(format_usage(USAGE))
|
||||||
|
@ -112,12 +112,11 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.short('n')
|
.short('n')
|
||||||
.long(options::ADJUSTMENT)
|
.long(options::ADJUSTMENT)
|
||||||
.help("add N to the niceness (default is 10)")
|
.help("add N to the niceness (default is 10)")
|
||||||
.takes_value(true)
|
|
||||||
.allow_hyphen_values(true),
|
.allow_hyphen_values(true),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::COMMAND)
|
Arg::new(options::COMMAND)
|
||||||
.multiple_occurrences(true)
|
.action(ArgAction::Append)
|
||||||
.value_hint(clap::ValueHint::CommandName),
|
.value_hint(clap::ValueHint::CommandName),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue