tty: correct exit code for wrong args

This commit is contained in:
Michael Debertol
2021-06-16 17:43:38 +02:00
parent d8d0078dde
commit 3c271304f5
+9 -1
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);