diff --git a/src/uu/yes/Cargo.toml b/src/uu/yes/Cargo.toml index 208e7956b..677d60a5f 100644 --- a/src/uu/yes/Cargo.toml +++ b/src/uu/yes/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" path = "src/yes.rs" [dependencies] -clap = { version = "3.2", features = ["wrap_help", "cargo"] } +clap = { version = "4.0", features = ["wrap_help", "cargo"] } libc = "0.2.135" uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["pipes"] } diff --git a/src/uu/yes/src/yes.rs b/src/uu/yes/src/yes.rs index 0dfa77195..cc04d26bc 100644 --- a/src/uu/yes/src/yes.rs +++ b/src/uu/yes/src/yes.rs @@ -10,7 +10,7 @@ use std::borrow::Cow; use std::io::{self, Result, Write}; -use clap::{Arg, Command}; +use clap::{Arg, ArgAction, Command}; use uucore::error::{UResult, USimpleError}; use uucore::format_usage; @@ -47,11 +47,11 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { } } -pub fn uu_app<'a>() -> Command<'a> { +pub fn uu_app() -> Command { Command::new(uucore::util_name()) .about(ABOUT) .override_usage(format_usage(USAGE)) - .arg(Arg::new("STRING").index(1).multiple_occurrences(true)) + .arg(Arg::new("STRING").action(ArgAction::Append)) .infer_long_args(true) }