Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser): Improve args_conflicts_with_subcommands experience #5298

Merged
merged 10 commits into from
Jan 11, 2024

Conversation

epage
Copy link
Member

@epage epage commented Jan 11, 2024

The error was bad and there were holes from adding subcommand flags

Fixes #5297

@epage epage merged commit a5d4641 into clap-rs:master Jan 11, 2024
22 checks passed
@epage epage deleted the conflict branch January 11, 2024 16:36
epage added a commit to epage/clap that referenced this pull request Jan 15, 2024
With clap-rs#5298, I had overlooked that `matcher.arg_ids()` includes
`ArgGroup`s.  I had assumed I could always find a present `id` among
`Arg`s and `unwrap`ed.

I skipped a test for this because the use case is a bit strange that the
long term value for the test would likely be low.
If/when we add derive support for `args_conflicts_with_subcommands`, it
will then cover this case.

Fixes clap-rs#5304
remi-delmas-3000 pushed a commit to remi-delmas-3000/kani that referenced this pull request Jan 18, 2024
Starting from clap v4.4.15 clap-rs/clap#5298
UnknownArgument errors are reported as ArgumentConflict errors.
celinval pushed a commit to model-checking/kani that referenced this pull request Jan 19, 2024
Starting from clap v4.4.15 clap-rs/clap#5298 in
some cases `UnknownArgument` errors are reported as `ArgumentConflict`
errors.

Co-authored-by: Remi Delmas <delmasrd@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subcommand flags can't conflict with arguments
1 participant