From d52887e6c01154fa1008e582436bba924c7be0ee Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Tue, 11 Jan 2022 14:40:31 +0100 Subject: [PATCH] pwd: clap 3 --- src/uu/pwd/Cargo.toml | 2 +- src/uu/pwd/src/pwd.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/uu/pwd/Cargo.toml b/src/uu/pwd/Cargo.toml index a168fb5aa..e6886c040 100644 --- a/src/uu/pwd/Cargo.toml +++ b/src/uu/pwd/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" path = "src/pwd.rs" [dependencies] -clap = { version = "2.33", features = ["wrap_help"] } +clap = { version = "3.0", features = ["wrap_help", "cargo"] } 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/pwd/src/pwd.rs b/src/uu/pwd/src/pwd.rs index 4b4819ed5..f152fa58a 100644 --- a/src/uu/pwd/src/pwd.rs +++ b/src/uu/pwd/src/pwd.rs @@ -128,7 +128,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 cwd = if matches.is_present(OPT_LOGICAL) { logical_path() } else { @@ -152,19 +152,19 @@ 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) .arg( - Arg::with_name(OPT_LOGICAL) - .short("L") + Arg::new(OPT_LOGICAL) + .short('L') .long(OPT_LOGICAL) .help("use PWD from environment, even if it contains symlinks"), ) .arg( - Arg::with_name(OPT_PHYSICAL) - .short("P") + Arg::new(OPT_PHYSICAL) + .short('P') .long(OPT_PHYSICAL) .overrides_with(OPT_LOGICAL) .help("avoid all symlinks"),