From dafa0737c890fda4e7d9e78e127f563a50b2fd75 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Tue, 11 Jan 2022 15:11:51 +0100 Subject: [PATCH] unexpand: clap 3 --- src/uu/unexpand/Cargo.toml | 2 +- src/uu/unexpand/src/unexpand.rs | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/uu/unexpand/Cargo.toml b/src/uu/unexpand/Cargo.toml index 3345e64c2..9318b5cd9 100644 --- a/src/uu/unexpand/Cargo.toml +++ b/src/uu/unexpand/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" path = "src/unexpand.rs" [dependencies] -clap = { version = "2.33", features = ["wrap_help"] } +clap = { version = "3.0", features = ["wrap_help", "cargo"] } unicode-width = "0.1.5" uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } diff --git a/src/uu/unexpand/src/unexpand.rs b/src/uu/unexpand/src/unexpand.rs index 1b227e4ce..83220a012 100644 --- a/src/uu/unexpand/src/unexpand.rs +++ b/src/uu/unexpand/src/unexpand.rs @@ -102,36 +102,36 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { unexpand(Options::new(matches)).map_err_context(String::new) } -pub fn uu_app() -> App<'static, 'static> { +pub fn uu_app<'a>() -> App<'a> { App::new(uucore::util_name()) .name(NAME) .version(crate_version!()) - .usage(USAGE) + .override_usage(USAGE) .about(SUMMARY) - .arg(Arg::with_name(options::FILE).hidden(true).multiple(true)) + .arg(Arg::new(options::FILE).hide(true).multiple_occurrences(true)) .arg( - Arg::with_name(options::ALL) - .short("a") + Arg::new(options::ALL) + .short('a') .long(options::ALL) .help("convert all blanks, instead of just initial blanks") .takes_value(false), ) .arg( - Arg::with_name(options::FIRST_ONLY) + Arg::new(options::FIRST_ONLY) .long(options::FIRST_ONLY) .help("convert only leading sequences of blanks (overrides -a)") .takes_value(false), ) .arg( - Arg::with_name(options::TABS) - .short("t") + Arg::new(options::TABS) + .short('t') .long(options::TABS) .long_help("use comma separated LIST of tab positions or have tabs N characters apart instead of 8 (enables -a)") .takes_value(true) ) .arg( - Arg::with_name(options::NO_UTF8) - .short("U") + Arg::new(options::NO_UTF8) + .short('U') .long(options::NO_UTF8) .takes_value(false) .help("interpret input file as 8-bit ASCII rather than UTF-8"))