mirror of
https://github.com/uutils/coreutils
synced 2024-12-04 18:39:52 +00:00
Merge pull request #6831 from DaringCuteSeal/mkdir-opt
mkdir: allow --parent to be provided more than once
This commit is contained in:
commit
c808faf10f
2 changed files with 14 additions and 1 deletions
|
@ -114,6 +114,7 @@ pub fn uu_app() -> Command {
|
|||
.short('p')
|
||||
.long(options::PARENTS)
|
||||
.help("make parent directories as needed")
|
||||
.overrides_with(options::PARENTS)
|
||||
.action(ArgAction::SetTrue),
|
||||
)
|
||||
.arg(
|
||||
|
|
|
@ -61,9 +61,21 @@ fn test_mkdir_parent() {
|
|||
let test_dir = "parent_dir/child_dir";
|
||||
|
||||
scene.ucmd().arg("-p").arg(test_dir).succeeds();
|
||||
scene.ucmd().arg("-p").arg(test_dir).succeeds();
|
||||
scene.ucmd().arg("-p").arg("-p").arg(test_dir).succeeds();
|
||||
scene.ucmd().arg("--parent").arg(test_dir).succeeds();
|
||||
scene
|
||||
.ucmd()
|
||||
.arg("--parent")
|
||||
.arg("--parent")
|
||||
.arg(test_dir)
|
||||
.succeeds();
|
||||
scene.ucmd().arg("--parents").arg(test_dir).succeeds();
|
||||
scene
|
||||
.ucmd()
|
||||
.arg("--parents")
|
||||
.arg("--parents")
|
||||
.arg(test_dir)
|
||||
.succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue