Make it easier to use clap validators with derive by generating arg associated constants? #3171
Open
2 tasks done
Labels
A-derive
Area: #[derive]` macro API
C-enhancement
Category: Raise on the bar on expectations
S-experimental
Status: Ongoing experiment that does not require reviewing and won't be merged in its current state.
Please complete the following tasks
Clap Version
3.0.0-rc.4
Describe your use case
When deriving, if you define a group, deal with requires, conflicts, overrides, etc, then you need to reference the field name. You can type it out and
App::debug_assert
will fail if you get it wrong.Example
Describe the solution you'd like
What if instead we generated something like
So you could do
I'm assuming this will work with macro expansion
Alternatives, if applicable
Provide helpers to avoid it, like #3165
Additional Context
This was inspired by #2475
The text was updated successfully, but these errors were encountered: