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

Help me catch mismatches in number of values and value names #2695

Closed
2 tasks done
epage opened this issue Aug 14, 2021 · 3 comments · Fixed by #3700
Closed
2 tasks done

Help me catch mismatches in number of values and value names #2695

epage opened this issue Aug 14, 2021 · 3 comments · Fixed by #3700
Assignees
Labels
A-builder C-enhancement S-waiting-on-decision
Milestone

Comments

@epage
Copy link
Member

@epage epage commented Aug 14, 2021

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Clap Version

3.0.0-beta.2

Describe your use case

The two main use cases I have for value names with multiple_values are

  • 1 value name repeated repeated for each value
  • Value name per value

Describe the solution you'd like

To catch mismatches in these, I'd like to have a debug assert so I know when I update one without the other

Alternatives, if applicable

No response

Additional Context

No response

@pksunkara
Copy link
Member

@pksunkara pksunkara commented Aug 14, 2021

1 value name repeated repeated for each value

That is a case of N:KN where number of values is a multiple of value names. (This is not supported in help message except when N = 1)

@pksunkara pksunkara added C: asserts A-help labels Aug 14, 2021
@epage
Copy link
Member Author

@epage epage commented Aug 14, 2021

Good point about that generalization of the 1:N case. Not sure if it ever shows up but if we have usage support for it, I'm assuming someone requested it at some point.

@epage epage added A-builder C-enhancement and removed A-help C: asserts labels Dec 8, 2021
@epage
Copy link
Member Author

@epage epage commented Dec 13, 2021

At minimum, we should have a debug assert for too many value names.

I am unsure how prevalent it is to have intentionally specify fewer value names.

@epage epage self-assigned this Dec 13, 2021
@epage epage added the S-waiting-on-decision label Dec 13, 2021
@epage epage added this to the 4.0 milestone Feb 8, 2022
epage added a commit to epage/clap that referenced this issue May 6, 2022
I can't think of a case for this or a way to render it.

Fixes clap-rs#2695
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builder C-enhancement S-waiting-on-decision
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants