1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 13:07:46 +00:00

tty: clap 3

This commit is contained in:
Terts Diepraam 2022-01-11 15:10:56 +01:00
parent 263357666f
commit 48c65934c7
2 changed files with 6 additions and 6 deletions

View file

@ -15,7 +15,7 @@ edition = "2018"
path = "src/tty.rs" path = "src/tty.rs"
[dependencies] [dependencies]
clap = { version = "2.33", features = ["wrap_help"] } clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42" libc = "0.2.42"
atty = "0.2" atty = "0.2"
uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] }

View file

@ -33,8 +33,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
.accept_any(); .accept_any();
let matches = uu_app() let matches = uu_app()
.usage(&usage[..]) .override_usage(&usage[..])
.get_matches_from_safe(args) .try_get_matches_from(args)
.map_err(|e| UUsageError::new(2, format!("{}", e)))?; .map_err(|e| UUsageError::new(2, format!("{}", e)))?;
let silent = matches.is_present(options::SILENT); let silent = matches.is_present(options::SILENT);
@ -71,15 +71,15 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
} }
} }
pub fn uu_app() -> App<'static, 'static> { pub fn uu_app<'a>() -> App<'a> {
App::new(uucore::util_name()) App::new(uucore::util_name())
.version(crate_version!()) .version(crate_version!())
.about(ABOUT) .about(ABOUT)
.arg( .arg(
Arg::with_name(options::SILENT) Arg::new(options::SILENT)
.long(options::SILENT) .long(options::SILENT)
.visible_alias("quiet") .visible_alias("quiet")
.short("s") .short('s')
.help("print nothing, only return an exit status") .help("print nothing, only return an exit status")
.required(false), .required(false),
) )