1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-10 01:47:46 +00:00

sum: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 14:54:55 +01:00
parent 0fca4460de
commit bad790840a
2 changed files with 12 additions and 8 deletions

View file

@ -15,7 +15,7 @@ edition = "2018"
path = "src/sum.rs"
[dependencies]
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" }

View file

@ -140,21 +140,25 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Ok(())
}
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::FILE).multiple(true).hidden(true))
.arg(
Arg::with_name(options::BSD_COMPATIBLE)
.short(options::BSD_COMPATIBLE)
Arg::new(options::FILE)
.multiple_occurrences(true)
.hide(true),
)
.arg(
Arg::new(options::BSD_COMPATIBLE)
.short('r')
.help("use the BSD sum algorithm, use 1K blocks (default)"),
)
.arg(
Arg::with_name(options::SYSTEM_V_COMPATIBLE)
.short("s")
Arg::new(options::SYSTEM_V_COMPATIBLE)
.short('s')
.long(options::SYSTEM_V_COMPATIBLE)
.help("use System V sum algorithm, use 512 bytes blocks"),
)