-
Notifications
You must be signed in to change notification settings - Fork 6
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
Consider disabling jopt short option clustering in Barclay Parser #119
Comments
I second this, I have just run into this problem and its causing Barclay error messages related to missing arguments to be unhelpful |
I vote for solving this asap, otherwise users get confused by the error messages in any downstream project! |
👍 to disabling clustering |
@droazen I've looked into this before, and recently again - and jopt doesn't appear to have a supported way to opt out of short arg clustering. We could detect and transform the error message in the exception for this case, but that would be awkward and brittle. I hacked together a solution that requires injecting a class into the jopt package namespace, which allows me to override an otherwise package protected method. Its pretty simple and seems to work. |
I suspect jopt would accept a patch that adds a toggle for clustering. We could probably push it upstream if we want. |
We should consider disabling the jopt feature of trying to interpret short options as clusters (i.e., "-abc" will be interpreted as "-a -b -c" if there is no short option named "abc") since it can have surprising consequences. If a tool has two args with short names "-0" and "-OVI", then "-OVI can be provided on the command line as a short name. If the tool has no short arg named "OVI", "-OVI" will be interpreted as "-O", "-V", "-I", with various failure modes ensuing based on the legitimacy of those names.
The text was updated successfully, but these errors were encountered: