-
Notifications
You must be signed in to change notification settings - Fork 23
Add support for ignoring unrecognized options/flags. #107
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
Comments
Ah, I had this request a while ago. Would love to be able to turn on "ignore unrecognized flags" |
Here's the original request: https://code.google.com/p/dart/issues/detail?id=14786 |
How do we tell if
when a positional is provided and allowed after it (see also #110). |
Perhaps assume a value taking option, since the user can use
|
I've started working on this. |
If we have to assume that unknown flags take values, we should require that |
The end user shouldn't have to care about "unknown options". That's an implementation detail. It would be a confusing error message: 'must include "--" when unknown options are allowed'. It'd also be a terrible UX to always have to use Something less drastic may make sense though, like requiring
The error message could be something like 'Cannot understand "--unknown bar". Please disambiguate with "--unknown bar --" or "--unknown -- bar"'. These would be fine:
|
Existing Dart tools that allow unknown options do so only when an
What if they pass |
Just because the arg parser doesn't validate the unknown args doesn't mean the program itself doesn't. |
my last comment assumes that the unknown args are exposed on the |
I don't understand how your point bears on the parser ambiguity. Such an ambiguity means there is no canonical result of the parse for those situations; that's a problem regardless of what the program does after parsing. |
Sorry, I was responding to:
Regarding:
I never understood why I would want
I agree. Need to think more about how to handle this.
There is at least no ambiguity when no unknown options are passed. |
We agree; the plan is to change it to default to
For situations like |
I think we just need to disallow any occurrences of |
As I understand it, the point of this feature is to be able to pass flags that work for some executables but not for others. If that's the case, disallowing |
Turns out I don't need this for my use case, so I don't have any current plans to work on this any further. |
Looks like there is no longer a pressing need for this. |
In
analyzer_cli
andanalysis_server
we work around this limitation by wrapping anArgParser
and filtering out unknown options ourselves but it would be far better if this were inargs
proper.The text was updated successfully, but these errors were encountered: