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

Implement more derive attributes for ArgGroup #4574

Closed
2 tasks done
Tracked by #3165
calavera opened this issue Dec 23, 2022 · 1 comment · Fixed by #4795
Closed
2 tasks done
Tracked by #3165

Implement more derive attributes for ArgGroup #4574

calavera opened this issue Dec 23, 2022 · 1 comment · Fixed by #4795
Labels
A-derive Area: #[derive]` macro API C-enhancement Category: Raise on the bar on expectations E-medium Call for participation: Experience needed to fix: Medium / intermediate

Comments

@calavera
Copy link

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

@calavera calavera added the C-enhancement Category: Raise on the bar on expectations label Dec 23, 2022
@epage
Copy link
Member

epage commented Dec 23, 2022

Yes, we need to support more attributes. This was being tracked as part of #3165 but I'm fine having a more specific issue.

@epage epage added E-medium Call for participation: Experience needed to fix: Medium / intermediate A-derive Area: #[derive]` macro API labels Dec 23, 2022
klnusbaum pushed a commit to klnusbaum/clap that referenced this issue Feb 1, 2023
This adds the "required" derive option for the group creation.
Needed for clap-rs#4574.
klnusbaum pushed a commit to klnusbaum/clap that referenced this issue Feb 1, 2023
This adds the "required" derive option for the group creation.
Needed for clap-rs#4574.
klnusbaum pushed a commit to klnusbaum/clap that referenced this issue Feb 3, 2023
This adds the ability derive additional options for the group creation.
Needed for clap-rs#4574.
@epage epage changed the title Implement more derive options for ArgGroup Implement more derive attributes for ArgGroup Feb 24, 2023
klnusbaum pushed a commit to klnusbaum/clap that referenced this issue Mar 4, 2023
This adds the "required" derive option for the group creation.
Needed for clap-rs#4574.
klnusbaum pushed a commit to klnusbaum/clap that referenced this issue Mar 4, 2023
This adds the ability derive additional options for the group creation.
Needed for clap-rs#4574.
epage pushed a commit to epage/clap that referenced this issue Mar 27, 2023
This adds the "required" derive option for the group creation.
Needed for clap-rs#4574.
epage pushed a commit to epage/clap that referenced this issue Mar 27, 2023
This adds the ability derive additional options for the group creation.

Fixes clap-rs#4574
epage pushed a commit to epage/clap that referenced this issue Mar 27, 2023
This adds the ability derive additional options for the group creation.

Fixes clap-rs#4574
epage pushed a commit to epage/clap that referenced this issue Mar 27, 2023
This adds the ability derive additional options for the group creation.

Fixes clap-rs#4574
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-derive Area: #[derive]` macro API C-enhancement Category: Raise on the bar on expectations E-medium Call for participation: Experience needed to fix: Medium / intermediate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants