1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 11:46:17 +00:00

printf: update to clap 4

This commit is contained in:
Terts Diepraam 2022-09-30 16:10:36 +02:00
parent 63b751f351
commit aad802616b
2 changed files with 14 additions and 6 deletions

View file

@ -18,7 +18,7 @@ edition = "2021"
path = "src/printf.rs"
[dependencies]
clap = { version = "3.2", features = ["wrap_help", "cargo"] }
clap = { version = "4.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["memo"] }
[[bin]]

View file

@ -2,7 +2,7 @@
// spell-checker:ignore (change!) each's
// spell-checker:ignore (ToDO) LONGHELP FORMATSTRING templating parameterizing formatstr
use clap::{crate_version, Arg, Command};
use clap::{crate_version, Arg, ArgAction, Command};
use uucore::error::{UResult, UUsageError};
use uucore::{format_usage, memo};
@ -285,19 +285,27 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Ok(())
}
pub fn uu_app<'a>() -> Command<'a> {
pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.allow_hyphen_values(true)
.version(crate_version!())
.about(ABOUT)
.after_help(AFTER_HELP)
.override_usage(format_usage(USAGE))
.arg(Arg::new(HELP).long(HELP).help("Print help information"))
.disable_help_flag(true)
.disable_version_flag(true)
.arg(
Arg::new(HELP)
.long(HELP)
.help("Print help information")
.action(ArgAction::Help),
)
.arg(
Arg::new(VERSION)
.long(VERSION)
.help("Print version information"),
.help("Print version information")
.action(ArgAction::Version),
)
.arg(Arg::new(options::FORMATSTRING))
.arg(Arg::new(options::ARGUMENT).multiple_occurrences(true))
.arg(Arg::new(options::ARGUMENT).action(ArgAction::Append))
}