mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
nproc: clap 3
This commit is contained in:
parent
5e9443567d
commit
5702313e9c
2 changed files with 5 additions and 7 deletions
|
@ -17,7 +17,7 @@ path = "src/nproc.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.42"
|
libc = "0.2.42"
|
||||||
num_cpus = "1.10"
|
num_cpus = "1.10"
|
||||||
clap = { version = "2.33", features = ["wrap_help"] }
|
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
|
||||||
uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] }
|
uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] }
|
||||||
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ fn usage() -> String {
|
||||||
#[uucore_procs::gen_uumain]
|
#[uucore_procs::gen_uumain]
|
||||||
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 ignore = match matches.value_of(OPT_IGNORE) {
|
let mut ignore = match matches.value_of(OPT_IGNORE) {
|
||||||
Some(numstr) => match numstr.parse() {
|
Some(numstr) => match numstr.parse() {
|
||||||
|
@ -71,19 +71,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())
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.about(ABOUT)
|
.about(ABOUT)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(OPT_ALL)
|
Arg::new(OPT_ALL)
|
||||||
.short("")
|
|
||||||
.long(OPT_ALL)
|
.long(OPT_ALL)
|
||||||
.help("print the number of cores available to the system"),
|
.help("print the number of cores available to the system"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(OPT_IGNORE)
|
Arg::new(OPT_IGNORE)
|
||||||
.short("")
|
|
||||||
.long(OPT_IGNORE)
|
.long(OPT_IGNORE)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("ignore up to N cores"),
|
.help("ignore up to N cores"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue