mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 15:22:38 +00:00
mktemp: allow default missing value
This commit is contained in:
parent
9293cbb05b
commit
53c4b0b81e
2 changed files with 9 additions and 0 deletions
|
@ -440,6 +440,9 @@ pub fn uu_app() -> Command {
|
|||
may contain slashes, but mktemp creates only the final component",
|
||||
)
|
||||
.value_name("DIR")
|
||||
// Allows use of default argument just by setting --tmpdir. Else,
|
||||
// use provided input to generate tmpdir
|
||||
.num_args(0..=1)
|
||||
.value_hint(clap::ValueHint::DirPath),
|
||||
)
|
||||
.arg(
|
||||
|
|
|
@ -825,3 +825,9 @@ fn test_nonexistent_dir_prefix() {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_default_missing_value() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
scene.ucmd().arg("-d").arg("--tmpdir").succeeds();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue