1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 13:07:46 +00:00

Merge pull request #4091 from dmatos2012/allow-default-value-mktemp

mktemp: allow default missing value
This commit is contained in:
Sylvestre Ledru 2022-11-03 20:46:11 +01:00 committed by GitHub
commit 2d79c4f693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -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(

View file

@ -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();
}