-
Notifications
You must be signed in to change notification settings - Fork 116
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
Disambiguate breaks options which are prefixes of others #419
Comments
Thanks for the report. When disambiguation is turned on, one can just type the prefix of an option, and if there's just one option which the user could be part way through typing, then that's what's selected. Here, "test" is a prefix of both options, so it's considered ambiguous. It's a bit ironic. So I think that's pretty undesirable behavior. I tend not to use the disambiguation system very much myself as once bash completion is turned on it doesn't really save users' typing, and in some ways it's a bit surprising. I'll have a think as to whether there's a nice solution. |
I figured this was the case. And I agree with you about the disambiguation system. I had it turned on since I was just testing options for some code via Whether or not there's a reasonable fix, it would probably be a good idea to explicitly mention this limitation in the documentation. Currently, this limitation is implied by the phrasing (since here "test" is not an unambiguous prefix), though I had jumped to the assumption that the disambiguation system would be smart enough to understand that there was an exact match. |
It should be possible to fix this by returning more precise match information from |
Fair enough. I don't need it fixed for any of my applications since I generally don't use disambiguation. I just wanted to bring this to your attention. At the very least, I recommend adding this caveat to your documentation, though |
Add note about disambiguation quirk (#419)
I've added a note to the README. I'll close the issue for now, as I don't think it's worth complicating the code too much over what is essentially correct (albeit counter-intuitive) behaviour. We might revisit this in the future if and when the parsing code gets an overhaul. |
Discovered the following bug today. I haven't really explored it, but below is a seemingly minimal example:
Let's call this program
test
. Runningtest --test
yields:However,
test --test1
executes just fine. Furthermore, replacingmain
byparses either option just fine.
I've tried this with the latest versions (0.16.0.0 and 0.16.0.1) and also hopped back to 0.15.0.0 just to see if there was any difference.
The text was updated successfully, but these errors were encountered: