mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 05:27:45 +00:00
nice: clap 3
This commit is contained in:
parent
ba93684a7e
commit
64f57a9200
2 changed files with 6 additions and 6 deletions
|
@ -15,7 +15,7 @@ edition = "2018"
|
|||
path = "src/nice.rs"
|
||||
|
||||
[dependencies]
|
||||
clap = { version = "2.33", features = ["wrap_help"] }
|
||||
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
|
||||
libc = "0.2.42"
|
||||
nix = "0.23.1"
|
||||
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
|
||||
|
|
|
@ -40,7 +40,7 @@ process).",
|
|||
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);
|
||||
|
||||
let mut niceness = unsafe {
|
||||
nix::errno::Errno::clear();
|
||||
|
@ -107,17 +107,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())
|
||||
.setting(AppSettings::TrailingVarArg)
|
||||
.version(crate_version!())
|
||||
.arg(
|
||||
Arg::with_name(options::ADJUSTMENT)
|
||||
.short("n")
|
||||
Arg::new(options::ADJUSTMENT)
|
||||
.short('n')
|
||||
.long(options::ADJUSTMENT)
|
||||
.help("add N to the niceness (default is 10)")
|
||||
.takes_value(true)
|
||||
.allow_hyphen_values(true),
|
||||
)
|
||||
.arg(Arg::with_name(options::COMMAND).multiple(true))
|
||||
.arg(Arg::new(options::COMMAND).multiple_occurrences(true))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue