1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

true: update to clap 4

This commit is contained in:
Terts Diepraam 2022-10-01 11:40:29 +02:00
parent acf4ba75fe
commit ea8015589b
2 changed files with 4 additions and 4 deletions

View file

@ -15,7 +15,7 @@ edition = "2021"
path = "src/true.rs" path = "src/true.rs"
[dependencies] [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" } uucore = { version=">=0.0.16", package="uucore", path="../../uucore" }
[[bin]] [[bin]]

View file

@ -27,8 +27,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
if let Err(e) = command.try_get_matches_from_mut(args) { if let Err(e) = command.try_get_matches_from_mut(args) {
let error = match e.kind() { let error = match e.kind() {
clap::ErrorKind::DisplayHelp => command.print_help(), clap::error::ErrorKind::DisplayHelp => command.print_help(),
clap::ErrorKind::DisplayVersion => { clap::error::ErrorKind::DisplayVersion => {
writeln!(std::io::stdout(), "{}", command.render_version()) writeln!(std::io::stdout(), "{}", command.render_version())
} }
_ => Ok(()), _ => Ok(()),
@ -47,7 +47,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Ok(()) Ok(())
} }
pub fn uu_app<'a>() -> Command<'a> { pub fn uu_app() -> Command {
Command::new(uucore::util_name()) Command::new(uucore::util_name())
.version(clap::crate_version!()) .version(clap::crate_version!())
.about(ABOUT) .about(ABOUT)