mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 07:12:44 +00:00
mkdir: require argument
This commit is contained in:
parent
93c3d004d7
commit
6ad07a4fb3
2 changed files with 9 additions and 0 deletions
|
@ -127,6 +127,7 @@ pub fn uu_app() -> Command {
|
||||||
Arg::new(options::DIRS)
|
Arg::new(options::DIRS)
|
||||||
.action(ArgAction::Append)
|
.action(ArgAction::Append)
|
||||||
.num_args(1..)
|
.num_args(1..)
|
||||||
|
.required(true)
|
||||||
.value_parser(ValueParser::os_string())
|
.value_parser(ValueParser::os_string())
|
||||||
.value_hint(clap::ValueHint::DirPath),
|
.value_hint(clap::ValueHint::DirPath),
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,6 +15,14 @@ fn test_invalid_arg() {
|
||||||
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_no_arg() {
|
||||||
|
new_ucmd!()
|
||||||
|
.fails()
|
||||||
|
.code_is(1)
|
||||||
|
.stderr_contains("error: the following required arguments were not provided:");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_mkdir_mkdir() {
|
fn test_mkdir_mkdir() {
|
||||||
new_ucmd!().arg("test_dir").succeeds();
|
new_ucmd!().arg("test_dir").succeeds();
|
||||||
|
|
Loading…
Reference in a new issue