diff --git a/clap_builder/src/parser/validator.rs b/clap_builder/src/parser/validator.rs index f2f2164c4bf..d62fd8109ed 100644 --- a/clap_builder/src/parser/validator.rs +++ b/clap_builder/src/parser/validator.rs @@ -335,7 +335,7 @@ impl<'cmd> Validator<'cmd> { required = true; } - if required { + if !is_exclusive_present && required { missing_required.push(a.get_id().clone()); if !a.is_last_set() { highest_index = highest_index.max(a.get_index().unwrap_or(0)); diff --git a/tests/builder/conflicts.rs b/tests/builder/conflicts.rs index d9964c9ba9f..f6491fb9a8d 100644 --- a/tests/builder/conflicts.rs +++ b/tests/builder/conflicts.rs @@ -721,7 +721,7 @@ fn exclusive_with_required_unless_present() { cmd.clone() .try_get_matches_from(["bug", "--exclusive"]) - .unwrap_err(); + .unwrap(); } #[test] @@ -761,7 +761,7 @@ fn exclusive_with_required_unless_present_any() { cmd.clone() .try_get_matches_from(["bug", "--exclusive"]) - .unwrap_err(); + .unwrap(); } #[test] @@ -801,7 +801,7 @@ fn exclusive_with_required_unless_present_all() { cmd.clone() .try_get_matches_from(["bug", "--exclusive"]) - .unwrap_err(); + .unwrap(); } #[test]