1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

tty: correct exit code for wrong args

This commit is contained in:
Michael Debertol 2021-06-16 16:54:28 +02:00
parent d8d0078dde
commit 3c271304f5

View file

@ -44,7 +44,15 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
.help("print nothing, only return an exit status")
.required(false),
)
.get_matches_from(args);
.get_matches_from_safe(args);
let matches = match matches {
Ok(m) => m,
Err(e) => {
eprint!("{}", e);
return 2;
}
};
let silent = matches.is_present(options::SILENT);