From 2cd32beb70394061e8a093f6f9a8a87fe292c394 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Tue, 11 Jan 2022 15:21:05 +0100 Subject: [PATCH] unlink --- src/uu/unlink/Cargo.toml | 2 +- src/uu/unlink/src/unlink.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/uu/unlink/Cargo.toml b/src/uu/unlink/Cargo.toml index c4b7d49cb..1bf49568b 100644 --- a/src/uu/unlink/Cargo.toml +++ b/src/uu/unlink/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" path = "src/unlink.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/unlink/src/unlink.rs b/src/uu/unlink/src/unlink.rs index 58bb5442c..aa924523f 100644 --- a/src/uu/unlink/src/unlink.rs +++ b/src/uu/unlink/src/unlink.rs @@ -27,9 +27,14 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { remove_file(path).map_err_context(|| format!("cannot unlink {}", path.quote())) } -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_PATH).required(true).hidden(true)) + .arg( + Arg::new(OPT_PATH) + .required(true) + .hide(true) + .allow_invalid_utf8(true), + ) }