Skip to content

CommandParser unrecognised option support #602

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 6, 2023 · 0 comments
Closed

CommandParser unrecognised option support #602

jvalkeal opened this issue Jan 6, 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

jvalkeal commented Jan 6, 2023

This was somewhat missed when rework from 1.x/2.0.x to 2.1.x happened. When user is defining option which doesn't exist parser adds it as positional argument(which it then kinda is) but what really should happen is that anything starting with '-' is reported as error, aka UnrecognisedOptionException.

@jvalkeal jvalkeal added type/enhancement Is an enhancement request for/backport For backporting branch/2.1.x Issue for a branch labels Jan 6, 2023
@jvalkeal jvalkeal added this to the 3.0.0-RC1 milestone Jan 6, 2023
@jvalkeal jvalkeal self-assigned this Jan 6, 2023
jvalkeal added a commit that referenced this issue Jan 7, 2023
- This commit modifies CommandParser to better track positional parameters
  which previously used to go there for non-recognised options. Now using
  relatively dump logic of just checking if first positional parameter starts
  with '-' which indicates it's a candidate for a new `UnrecognisedOptionException`
  which then would give user an error "Unrecognised option '--xxx'" for example.
- Backport #601
- Backport #602
- Fixes #603
- Fixes #604
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