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

Deprecate multiple_occurrences, removing it on next breaking change #3772

Closed
epage opened this issue May 31, 2022 · 0 comments
Closed

Deprecate multiple_occurrences, removing it on next breaking change #3772

epage opened this issue May 31, 2022 · 0 comments
Labels
A-parsing Area: Parser's logic and needs it changed somehow. M-breaking-change Meta: Implementing or merging this will introduce a breaking change. S-waiting-on-decision Status: Waiting on a go/no-go before implementing
Milestone

Comments

@epage
Copy link
Member

epage commented May 31, 2022

With #3405, we are adding Actions. This would allow us to fold multiple occurrences into Actions if we are willing for Command::args_override_self to be exclusively the behavior.

This would remove mixing of multiple occurrences and multiple values for positionals, leading us to reject issues like #3763.

This means we need to revisit #2993. We'd need to have different behavior for flags (default to Extend) and positional arguments (default to Set with multiple values).

@epage epage added M-breaking-change Meta: Implementing or merging this will introduce a breaking change. S-waiting-on-decision Status: Waiting on a go/no-go before implementing A-parsing Area: Parser's logic and needs it changed somehow. labels May 31, 2022
@epage epage added this to the 4.0 milestone May 31, 2022
epage added a commit to epage/clap that referenced this issue May 31, 2022
This changes how occurrences and values are grouped for multiple values.
Today, it appears as a bug.  If we move forward with clap-rs#3772, then this
can make sense.
epage added a commit to epage/clap that referenced this issue May 31, 2022
If we felt this was important long-term, we should fix this outside of
the Action.  Since we might be changing up occurrences (clap-rs#3772), we can
probably get away with a hack.
@epage epage changed the title Remove multiple_occurrences Deprecate multiple_occurrences, removing it on next breaking change Jun 7, 2022
epage added a commit to epage/clap that referenced this issue Jun 8, 2022
For programs opting into the clap v4 behavior (with `action` or
`value_parser` attributes), we'll no longer generate a
`multiple_occurrences(true)` call in preparation for deprecating
`multiple_occurrences`.  See clap-rs#3772.
epage added a commit to epage/clap that referenced this issue Jun 8, 2022
@epage epage closed this as completed in 14a62e1 Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parsing Area: Parser's logic and needs it changed somehow. M-breaking-change Meta: Implementing or merging this will introduce a breaking change. S-waiting-on-decision Status: Waiting on a go/no-go before implementing
Projects
None yet
Development

No branches or pull requests

1 participant