-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
💸 $20A-deriveArea: #[derive]` macro APIArea: #[derive]` macro APIC-enhancementCategory: Raise on the bar on expectationsCategory: Raise on the bar on expectationsE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Experience needed to fix: Medium / intermediateCall for participation: Experience needed to fix: Medium / intermediate
Milestone
Description
Maintainer's notes
- Expose
#[derive(Args)]
as anArgGroup
#4210 - feat(derive): Implicitly populate groups from some structs #4303
- feat(derive): Report the group id #4305
- Optional, nested flatten gets ignored (nested ArgGroups are unsupported) #4697
- Implement more derive attributes for ArgGroup #4574
Please complete the following tasks
- I have searched the discussions
- I have searched the existing issues
Clap Version
3.0.0-rc.4
Describe your use case
I have a group of fields that I want to make a group for conflicting with other fields
Describe the solution you'd like
Inspired by #2621, what if we implicitly created a group from a struct?
#[derive(Args)]
struct Group {
arg1: String,
arg2: String
}
would have an implicitly created ArgGroup::new("Group").multiple(true)
.
You could then do
#[derive(Args)]
#[group(...group builder methods...)]
struct Group {
arg1: String,
arg2: String
}
Alternatives, if applicable
Manually define the args and deal with typos in arg and group names and issues like #2475
Additional Context
The big issue is defining this to not conflict with other app or group attributes. Somewhere I brought up the idea of more explicitly naming our attributes as clap::app
,. clap::args
, etc (#1553). Maybe that can help?
Per-builder attributes are n
ow in
schneiderfelipe
Metadata
Metadata
Assignees
Labels
💸 $20A-deriveArea: #[derive]` macro APIArea: #[derive]` macro APIC-enhancementCategory: Raise on the bar on expectationsCategory: Raise on the bar on expectationsE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Experience needed to fix: Medium / intermediateCall for participation: Experience needed to fix: Medium / intermediate