mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 01:38:04 +00:00
Merge pull request #3578 from jfinkels/mktemp-usage-error-status-1
mktemp: exit with status 1 on usage errors
This commit is contained in:
commit
a240b1cef3
2 changed files with 6 additions and 1 deletions
|
@ -91,7 +91,7 @@ impl Display for MkTempError {
|
|||
|
||||
#[uucore::main]
|
||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
let matches = uu_app().get_matches_from(args);
|
||||
let matches = uu_app().try_get_matches_from(args)?;
|
||||
|
||||
let template = matches.value_of(ARG_TEMPLATE).unwrap();
|
||||
let tmpdir = matches.value_of(OPT_TMPDIR).unwrap_or_default();
|
||||
|
|
|
@ -558,3 +558,8 @@ fn test_too_few_xs_suffix_directory() {
|
|||
.fails()
|
||||
.stderr_only("mktemp: too few X's in template 'aXXX'\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_too_many_arguments() {
|
||||
new_ucmd!().args(&["-q", "a", "b"]).fails().code_is(1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue