mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
tty: update to clap 4
This commit is contained in:
parent
1d147c03f6
commit
e94ef2f8b5
2 changed files with 5 additions and 5 deletions
|
@ -15,7 +15,7 @@ edition = "2021"
|
|||
path = "src/tty.rs"
|
||||
|
||||
[dependencies]
|
||||
clap = { version = "3.2", features = ["wrap_help", "cargo"] }
|
||||
clap = { version = "4.0", features = ["wrap_help", "cargo"] }
|
||||
nix = "0.25"
|
||||
atty = "0.2"
|
||||
uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["fs"] }
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
// spell-checker:ignore (ToDO) ttyname filedesc
|
||||
|
||||
use clap::{crate_version, Arg, Command};
|
||||
use clap::{crate_version, Arg, ArgAction, Command};
|
||||
use std::io::Write;
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use uucore::error::{set_exit_code, UResult};
|
||||
|
@ -26,7 +26,7 @@ mod options {
|
|||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
let matches = uu_app().get_matches_from(args);
|
||||
|
||||
let silent = matches.contains_id(options::SILENT);
|
||||
let silent = matches.get_flag(options::SILENT);
|
||||
|
||||
// If silent, we don't need the name, only whether or not stdin is a tty.
|
||||
if silent {
|
||||
|
@ -59,7 +59,7 @@ 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())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
|
@ -71,6 +71,6 @@ pub fn uu_app<'a>() -> Command<'a> {
|
|||
.visible_alias("quiet")
|
||||
.short('s')
|
||||
.help("print nothing, only return an exit status")
|
||||
.required(false),
|
||||
.action(ArgAction::SetTrue),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue