diff --git a/src/uu/mkdir/src/mkdir.rs b/src/uu/mkdir/src/mkdir.rs index 46084ba9eea..9928271e751 100644 --- a/src/uu/mkdir/src/mkdir.rs +++ b/src/uu/mkdir/src/mkdir.rs @@ -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( diff --git a/tests/by-util/test_mkdir.rs b/tests/by-util/test_mkdir.rs index b9d5275f493..a0b926689d1 100644 --- a/tests/by-util/test_mkdir.rs +++ b/tests/by-util/test_mkdir.rs @@ -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]