From 48c65934c7641d3b4ced50a39e0dde43d0f4bc44 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Tue, 11 Jan 2022 15:10:56 +0100 Subject: [PATCH] tty: clap 3 --- src/uu/tty/Cargo.toml | 2 +- src/uu/tty/src/tty.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uu/tty/Cargo.toml b/src/uu/tty/Cargo.toml index b5d36f304..2724e1b0f 100644 --- a/src/uu/tty/Cargo.toml +++ b/src/uu/tty/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" path = "src/tty.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/tty/src/tty.rs b/src/uu/tty/src/tty.rs index 3a02803c0..498ea1655 100644 --- a/src/uu/tty/src/tty.rs +++ b/src/uu/tty/src/tty.rs @@ -33,8 +33,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { .accept_any(); let matches = uu_app() - .usage(&usage[..]) - .get_matches_from_safe(args) + .override_usage(&usage[..]) + .try_get_matches_from(args) .map_err(|e| UUsageError::new(2, format!("{}", e)))?; let silent = matches.is_present(options::SILENT); @@ -71,15 +71,15 @@ 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::SILENT) + Arg::new(options::SILENT) .long(options::SILENT) .visible_alias("quiet") - .short("s") + .short('s') .help("print nothing, only return an exit status") .required(false), )