From 5e9443567d21dc489a607a252f0fecb718204ecc Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Tue, 11 Jan 2022 14:15:06 +0100 Subject: [PATCH] nohup: clap 3 --- src/uu/nohup/Cargo.toml | 2 +- src/uu/nohup/src/nohup.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uu/nohup/Cargo.toml b/src/uu/nohup/Cargo.toml index 9fa2f009a..b44113c95 100644 --- a/src/uu/nohup/Cargo.toml +++ b/src/uu/nohup/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" path = "src/nohup.rs" [dependencies] -clap = { version = "2.33", features = ["wrap_help"] } +clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" atty = "0.2" uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } diff --git a/src/uu/nohup/src/nohup.rs b/src/uu/nohup/src/nohup.rs index 505911b3e..a0305474b 100644 --- a/src/uu/nohup/src/nohup.rs +++ b/src/uu/nohup/src/nohup.rs @@ -88,7 +88,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { .collect_str(InvalidEncodingHandling::ConvertLossy) .accept_any(); - let matches = uu_app().usage(&usage[..]).get_matches_from(args); + let matches = uu_app().override_usage(&usage[..]).get_matches_from(args); replace_fds()?; @@ -114,16 +114,16 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { Ok(()) } -pub fn uu_app() -> App<'static, 'static> { +pub fn uu_app<'a>() -> App<'a> { App::new(uucore::util_name()) .version(crate_version!()) .about(ABOUT) .after_help(LONG_HELP) .arg( - Arg::with_name(options::CMD) - .hidden(true) + Arg::new(options::CMD) + .hide(true) .required(true) - .multiple(true), + .multiple_occurrences(true), ) .setting(AppSettings::TrailingVarArg) }