Skip to content

CommandParser should enforce arity settings #614

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

Closed
jvalkeal opened this issue Jan 12, 2023 · 0 comments
Closed

CommandParser should enforce arity settings #614

jvalkeal opened this issue Jan 12, 2023 · 0 comments
Assignees
Labels
branch/2.1.x Issue for a branch for/backport For backporting type/enhancement Is an enhancement request
Milestone

Comments

@jvalkeal
Copy link
Contributor

CommandRegistration can have arity min/max which can be interpreted from a type but user can still set it. For example if type is an array or a list user may want to impose restrictions that option arguments takes minimum of 2 and maximum of 3.

Should then add parser exception so that these cases are then reported back to user.

@jvalkeal jvalkeal added type/enhancement Is an enhancement request for/backport For backporting branch/2.1.x Issue for a branch labels Jan 12, 2023
@jvalkeal jvalkeal added this to the 3.0.0 milestone Jan 12, 2023
@jvalkeal jvalkeal self-assigned this Jan 12, 2023
jvalkeal added a commit that referenced this issue Jan 13, 2023
- Introduce new error TooManyArgumentsOptionException
  and NotEnoughArgumentsOptionException.
- Parser not tracks arity min/max and imposes
  if num of option arguments.
- Backport #614
- Fixes #615
- Original commit this sources had some additional changes
  which is not possible to merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch/2.1.x Issue for a branch for/backport For backporting type/enhancement Is an enhancement request
Projects
None yet
Development

No branches or pull requests

1 participant