1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-17 20:26:18 +00:00

expand: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 13:28:05 +01:00
parent 4d917e28b2
commit 449a536c59
2 changed files with 12 additions and 12 deletions

View file

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

View file

@ -174,39 +174,39 @@ impl Options {
#[uucore_procs::gen_uumain]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage();
let matches = uu_app().usage(&usage[..]).get_matches_from(args);
let matches = uu_app().override_usage(&usage[..]).get_matches_from(args);
expand(Options::new(&matches)).map_err_context(|| "failed to write output".to_string())
}
pub fn uu_app() -> App<'static, 'static> {
pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name())
.version(crate_version!())
.about(ABOUT)
.after_help(LONG_HELP)
.arg(
Arg::with_name(options::INITIAL)
Arg::new(options::INITIAL)
.long(options::INITIAL)
.short("i")
.short('i')
.help("do not convert tabs after non blanks"),
)
.arg(
Arg::with_name(options::TABS)
Arg::new(options::TABS)
.long(options::TABS)
.short("t")
.short('t')
.value_name("N, LIST")
.takes_value(true)
.help("have tabs N characters apart, not 8 or use comma separated list of explicit tab positions"),
)
.arg(
Arg::with_name(options::NO_UTF8)
Arg::new(options::NO_UTF8)
.long(options::NO_UTF8)
.short("U")
.short('U')
.help("interpret input file as 8-bit ASCII rather than UTF-8"),
).arg(
Arg::with_name(options::FILES)
.multiple(true)
.hidden(true)
Arg::new(options::FILES)
.multiple_occurrences(true)
.hide(true)
.takes_value(true)
)
}