tee: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 15:02:09 +01:00
parent 9c9643807a
commit 3cac8a631f
2 changed files with 8 additions and 8 deletions

View file

@ -15,7 +15,7 @@ edition = "2018"
path = "src/tee.rs" path = "src/tee.rs"
[dependencies] [dependencies]
clap = { version = "2.33", features = ["wrap_help"] } clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42" libc = "0.2.42"
retain_mut = "=0.1.2" # ToDO: [2021-01-01; rivy; maint/MinSRV] ~ v0.1.5 uses const generics which aren't stabilized until rust v1.51.0 retain_mut = "=0.1.2" # ToDO: [2021-01-01; rivy; maint/MinSRV] ~ v0.1.5 uses const generics which aren't stabilized until rust v1.51.0
uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["libc"] } uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["libc"] }

View file

@ -42,7 +42,7 @@ fn usage() -> String {
pub fn uumain(args: impl uucore::Args) -> UResult<()> { pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage(); 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 options = Options { let options = Options {
append: matches.is_present(options::APPEND), append: matches.is_present(options::APPEND),
@ -59,24 +59,24 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
} }
} }
pub fn uu_app() -> App<'static, 'static> { pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.after_help("If a FILE is -, it refers to a file named - .") .after_help("If a FILE is -, it refers to a file named - .")
.arg( .arg(
Arg::with_name(options::APPEND) Arg::new(options::APPEND)
.long(options::APPEND) .long(options::APPEND)
.short("a") .short('a')
.help("append to the given FILEs, do not overwrite"), .help("append to the given FILEs, do not overwrite"),
) )
.arg( .arg(
Arg::with_name(options::IGNORE_INTERRUPTS) Arg::new(options::IGNORE_INTERRUPTS)
.long(options::IGNORE_INTERRUPTS) .long(options::IGNORE_INTERRUPTS)
.short("i") .short('i')
.help("ignore interrupt signals (ignored on non-Unix platforms)"), .help("ignore interrupt signals (ignored on non-Unix platforms)"),
) )
.arg(Arg::with_name(options::FILE).multiple(true)) .arg(Arg::new(options::FILE).multiple_occurrences(true))
} }
#[cfg(unix)] #[cfg(unix)]