mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
uptime: clap 3
This commit is contained in:
parent
2cd32beb70
commit
ac76eefb99
2 changed files with 5 additions and 5 deletions
|
@ -16,7 +16,7 @@ path = "src/uptime.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
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=["libc", "utmpx"] }
|
uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["libc", "utmpx"] }
|
||||||
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,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 (boot_time, user_count) = process_utmpx();
|
let (boot_time, user_count) = process_utmpx();
|
||||||
let uptime = get_uptime(boot_time);
|
let uptime = get_uptime(boot_time);
|
||||||
|
@ -62,13 +62,13 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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(options::SINCE)
|
Arg::new(options::SINCE)
|
||||||
.short("s")
|
.short('s')
|
||||||
.long(options::SINCE)
|
.long(options::SINCE)
|
||||||
.help("system up since"),
|
.help("system up since"),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue