Skip to content
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

Option parsing error (incomplete option name) #93

Closed
d-ash opened this issue Feb 14, 2015 · 4 comments
Closed

Option parsing error (incomplete option name) #93

d-ash opened this issue Feb 14, 2015 · 4 comments

Comments

@d-ash
Copy link

d-ash commented Feb 14, 2015

Passing only a beginning of a name triggers the option to be set.

For example, if --vagrant option is declared, passing --v or --va... to the script, works as if the full name has been passed.

However, global options work correctly (--v is not equivalent to --vagrant)

@d-ash
Copy link
Author

d-ash commented Feb 14, 2015

It seems that the problem is in OptionParser, and it's an old issue.
Could this be corrected within Commander code?

@ggilder
Copy link
Collaborator

ggilder commented Feb 16, 2015

Do you have a link to the issue in OptionParser? I would like to understand why it hasn't been fixed there.

@d-ash
Copy link
Author

d-ash commented Feb 17, 2015

https://www.ruby-forum.com/topic/143551
http://stackoverflow.com/questions/20654065/how-do-i-get-only-long-options-work-in-optionparser-in-ruby
I'd agree with the point that this behaviour is potentially dangerous. Options of CLI tools are very important part of UI, and they have to be processed rigorously, without any guessing and auto-completion.

@ggilder
Copy link
Collaborator

ggilder commented Apr 1, 2015

This issue was moved to commander-rb/commander#6

@ggilder ggilder closed this as completed Apr 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants