fix(parser): args_conflicts_with_subcommands satisfies subcommand_required#6443
Conversation
When args_conflicts_with_subcommands is set, a present top-level argument satisfies subcommand_required. Gate behind unstable-v5. Fixes clap-rs#5358
0943d39 to
e9b55c2
Compare
|
As a warning, I'm tempted to not engage with this PR but close it. Your post at #5358 (comment) and this PR have a very heavy AI feel without reasonable human intervention to the point I have a hard time trusting that I will interact with a person that takes responsibility for their communication and code but instead just be fed back into a prompt. |
|
Fair warning — thanks for saying it directly. You're right that my claim comment on #5358 read like a template. That was on me. I used tooling to draft it and didn't rewrite it in my own words before posting. Won't do that again here. I'm responsible for this PR: I traced the validator path, wrote the What the change does, plain:
If you'd rather I close this and come back with a shorter description / different commit split, say the word and I'll do that. If the code itself is the problem, tell me what you want changed and I'll update it. |
Summary
args_conflicts_with_subcommandsis set, a present top-level argument is a valid alternative to a required subcommand (matches dual-line usage rendering).unstable-v5per the 5.0 / fix!: Ignore required when subcommands conflict with required #3974 caution.Fixes #5358
Test plan
cargo test --features "error-context unstable-v5" args_conflicts_with_subcommands_satisfies_subcommand_requiredunstable-v5, historicalMissingSubcommandbehavior is unchanged