diff --git a/src/uu/tac/Cargo.toml b/src/uu/tac/Cargo.toml index 253ab4e2c..c63ed2ff6 100644 --- a/src/uu/tac/Cargo.toml +++ b/src/uu/tac/Cargo.toml @@ -20,7 +20,7 @@ path = "src/tac.rs" memchr = "2" memmap2 = "0.5" regex = "1" -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/tac/src/tac.rs b/src/uu/tac/src/tac.rs index 0a6599d7c..2285fcacc 100644 --- a/src/uu/tac/src/tac.rs +++ b/src/uu/tac/src/tac.rs @@ -60,34 +60,38 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { tac(files, before, regex, separator) } -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::BEFORE) - .short("b") + Arg::new(options::BEFORE) + .short('b') .long(options::BEFORE) .help("attach the separator before instead of after") .takes_value(false), ) .arg( - Arg::with_name(options::REGEX) - .short("r") + Arg::new(options::REGEX) + .short('r') .long(options::REGEX) .help("interpret the sequence as a regular expression") .takes_value(false), ) .arg( - Arg::with_name(options::SEPARATOR) - .short("s") + Arg::new(options::SEPARATOR) + .short('s') .long(options::SEPARATOR) .help("use STRING as the separator instead of newline") .takes_value(true), ) - .arg(Arg::with_name(options::FILE).hidden(true).multiple(true)) + .arg( + Arg::new(options::FILE) + .hide(true) + .multiple_occurrences(true), + ) } /// Print lines of a buffer in reverse, with line separator given as a regex.