From 805801ec39cfb3b01e4e4c36aea745af048cea32 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 26 Sep 2020 17:56:07 +0200 Subject: [PATCH 1/2] nproc: remove the extern crate declaration --- src/uu/nproc/Cargo.toml | 1 - src/uu/nproc/src/nproc.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/src/uu/nproc/Cargo.toml b/src/uu/nproc/Cargo.toml index 1689f3db6..681fe3032 100644 --- a/src/uu/nproc/Cargo.toml +++ b/src/uu/nproc/Cargo.toml @@ -15,7 +15,6 @@ edition = "2018" path = "src/nproc.rs" [dependencies] -getopts = "0.2.18" libc = "0.2.42" num_cpus = "1.10" clap = "2.33" diff --git a/src/uu/nproc/src/nproc.rs b/src/uu/nproc/src/nproc.rs index d18952276..049a7ab4e 100644 --- a/src/uu/nproc/src/nproc.rs +++ b/src/uu/nproc/src/nproc.rs @@ -8,7 +8,6 @@ // spell-checker:ignore (ToDO) NPROCESSORS nprocs numstr threadstr sysconf extern crate clap; -extern crate getopts; extern crate num_cpus; #[cfg(unix)] From c660684a8c5430f0f98f6526709edd5ddd230d85 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 26 Sep 2020 18:05:32 +0200 Subject: [PATCH 2/2] nproc: use the variable name --- src/uu/nproc/src/nproc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uu/nproc/src/nproc.rs b/src/uu/nproc/src/nproc.rs index 049a7ab4e..ec8aaf90a 100644 --- a/src/uu/nproc/src/nproc.rs +++ b/src/uu/nproc/src/nproc.rs @@ -47,13 +47,13 @@ pub fn uumain(args: impl uucore::Args) -> i32 { .arg( Arg::with_name(OPT_ALL) .short("") - .long("all") + .long(OPT_ALL) .help("print the number of cores available to the system"), ) .arg( Arg::with_name(OPT_IGNORE) .short("") - .long("ignore") + .long(OPT_IGNORE) .takes_value(true) .help("ignore up to N cores"), )