mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-02 05:57:46 +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"
|
path = "src/nice.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "2.33", features = ["wrap_help"] }
|
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.42"
|
libc = "0.2.42"
|
||||||
nix = "0.23.1"
|
nix = "0.23.1"
|
||||||
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
|
||||||
|
|
|
@ -40,7 +40,7 @@ process).",
|
||||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
let usage = usage();
|
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 {
|
let mut niceness = unsafe {
|
||||||
nix::errno::Errno::clear();
|
nix::errno::Errno::clear();
|
||||||
|
@ -107,17 +107,17 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn uu_app() -> App<'static, 'static> {
|
pub fn uu_app<'a>() -> App<'a> {
|
||||||
App::new(uucore::util_name())
|
App::new(uucore::util_name())
|
||||||
.setting(AppSettings::TrailingVarArg)
|
.setting(AppSettings::TrailingVarArg)
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(options::ADJUSTMENT)
|
Arg::new(options::ADJUSTMENT)
|
||||||
.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)
|
.takes_value(true)
|
||||||
.allow_hyphen_values(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