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"
[dependencies]
clap = { version = "2.33", features = ["wrap_help"] }
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42"
atty = "0.2"
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();
let matches = uu_app()
.usage(&usage[..])
.get_matches_from_safe(args)
.override_usage(&usage[..])
.try_get_matches_from(args)
.map_err(|e| UUsageError::new(2, format!("{}", e)))?;
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())
.version(crate_version!())
.about(ABOUT)
.arg(
Arg::with_name(options::SILENT)
Arg::new(options::SILENT)
.long(options::SILENT)
.visible_alias("quiet")
.short("s")
.short('s')
.help("print nothing, only return an exit status")
.required(false),
)