diff --git a/src/uu/uptime/Cargo.toml b/src/uu/uptime/Cargo.toml index 785955afc..60b176c37 100644 --- a/src/uu/uptime/Cargo.toml +++ b/src/uu/uptime/Cargo.toml @@ -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" } diff --git a/src/uu/uptime/src/uptime.rs b/src/uu/uptime/src/uptime.rs index eabcd1abf..4b52a68a7 100644 --- a/src/uu/uptime/src/uptime.rs +++ b/src/uu/uptime/src/uptime.rs @@ -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"), )