From 3cac8a631f0cfc98567fe469cbb74c5c7a03aee1 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Tue, 11 Jan 2022 15:02:09 +0100 Subject: [PATCH] tee: clap 3 --- src/uu/tee/Cargo.toml | 2 +- src/uu/tee/src/tee.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/uu/tee/Cargo.toml b/src/uu/tee/Cargo.toml index a984a2f66..9de6f22be 100644 --- a/src/uu/tee/Cargo.toml +++ b/src/uu/tee/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" path = "src/tee.rs" [dependencies] -clap = { version = "2.33", features = ["wrap_help"] } +clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" retain_mut = "=0.1.2" # ToDO: [2021-01-01; rivy; maint/MinSRV] ~ v0.1.5 uses const generics which aren't stabilized until rust v1.51.0 uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["libc"] } diff --git a/src/uu/tee/src/tee.rs b/src/uu/tee/src/tee.rs index 9629e711d..5e26c6491 100644 --- a/src/uu/tee/src/tee.rs +++ b/src/uu/tee/src/tee.rs @@ -42,7 +42,7 @@ fn usage() -> String { 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 options = Options { append: matches.is_present(options::APPEND), @@ -59,24 +59,24 @@ 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) .after_help("If a FILE is -, it refers to a file named - .") .arg( - Arg::with_name(options::APPEND) + Arg::new(options::APPEND) .long(options::APPEND) - .short("a") + .short('a') .help("append to the given FILEs, do not overwrite"), ) .arg( - Arg::with_name(options::IGNORE_INTERRUPTS) + Arg::new(options::IGNORE_INTERRUPTS) .long(options::IGNORE_INTERRUPTS) - .short("i") + .short('i') .help("ignore interrupt signals (ignored on non-Unix platforms)"), ) - .arg(Arg::with_name(options::FILE).multiple(true)) + .arg(Arg::new(options::FILE).multiple_occurrences(true)) } #[cfg(unix)]