Skip to content

Implement more derive attributes for ArgGroup #4574

@calavera

Description

@calavera

Please complete the following tasks

Clap Version

4.0.32

Describe your use case

clap_derive only supports the skip option for the group macro, as in #[group(skip)]. This is documented accordingly in https://docs.rs/clap/latest/clap/_derive/index.html#arggroup-attributes

I wrote a struct that would benefit from having more options like requires, requires_all, conflicts_with, and conflicts_with_all:

https://github.com/cargo-lambda/cargo-lambda/blob/main/crates/cargo-lambda-new/src/lib.rs#L37-L43
https://docs.rs/clap/latest/clap/builder/struct.ArgGroup.html

Describe the solution you'd like

I'd like to be able to use those options in the group macro.

I don't mind to implement it myself if I can get some hints on how to do it, I've never contributed to this project and I'm a little bit lost in all the macro logic.

Alternatives, if applicable

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-deriveArea: #[derive]` macro APIC-enhancementCategory: Raise on the bar on expectationsE-mediumCall for participation: Experience needed to fix: Medium / intermediate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions