1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 12:37:49 +00:00

unexpand: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 15:11:51 +01:00
parent 7de993fa4f
commit dafa0737c8
2 changed files with 11 additions and 11 deletions

View file

@ -15,7 +15,7 @@ edition = "2018"
path = "src/unexpand.rs" path = "src/unexpand.rs"
[dependencies] [dependencies]
clap = { version = "2.33", features = ["wrap_help"] } clap = { version = "3.0", features = ["wrap_help", "cargo"] }
unicode-width = "0.1.5" unicode-width = "0.1.5"
uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } uucore = { version=">=0.0.10", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" }

View file

@ -102,36 +102,36 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
unexpand(Options::new(matches)).map_err_context(String::new) unexpand(Options::new(matches)).map_err_context(String::new)
} }
pub fn uu_app() -> App<'static, 'static> { pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.name(NAME) .name(NAME)
.version(crate_version!()) .version(crate_version!())
.usage(USAGE) .override_usage(USAGE)
.about(SUMMARY) .about(SUMMARY)
.arg(Arg::with_name(options::FILE).hidden(true).multiple(true)) .arg(Arg::new(options::FILE).hide(true).multiple_occurrences(true))
.arg( .arg(
Arg::with_name(options::ALL) Arg::new(options::ALL)
.short("a") .short('a')
.long(options::ALL) .long(options::ALL)
.help("convert all blanks, instead of just initial blanks") .help("convert all blanks, instead of just initial blanks")
.takes_value(false), .takes_value(false),
) )
.arg( .arg(
Arg::with_name(options::FIRST_ONLY) Arg::new(options::FIRST_ONLY)
.long(options::FIRST_ONLY) .long(options::FIRST_ONLY)
.help("convert only leading sequences of blanks (overrides -a)") .help("convert only leading sequences of blanks (overrides -a)")
.takes_value(false), .takes_value(false),
) )
.arg( .arg(
Arg::with_name(options::TABS) Arg::new(options::TABS)
.short("t") .short('t')
.long(options::TABS) .long(options::TABS)
.long_help("use comma separated LIST of tab positions or have tabs N characters apart instead of 8 (enables -a)") .long_help("use comma separated LIST of tab positions or have tabs N characters apart instead of 8 (enables -a)")
.takes_value(true) .takes_value(true)
) )
.arg( .arg(
Arg::with_name(options::NO_UTF8) Arg::new(options::NO_UTF8)
.short("U") .short('U')
.long(options::NO_UTF8) .long(options::NO_UTF8)
.takes_value(false) .takes_value(false)
.help("interpret input file as 8-bit ASCII rather than UTF-8")) .help("interpret input file as 8-bit ASCII rather than UTF-8"))