mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27: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]
|
||||
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_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ fn usage() -> String {
|
|||
#[uucore_procs::gen_uumain]
|
||||
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 (boot_time, user_count) = process_utmpx();
|
||||
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())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
Arg::with_name(options::SINCE)
|
||||
.short("s")
|
||||
Arg::new(options::SINCE)
|
||||
.short('s')
|
||||
.long(options::SINCE)
|
||||
.help("system up since"),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue