Actions
Feature #11523
closedoptparse short options will match complete options
Feature #11523:
optparse short options will match complete options
[ruby-core:<unknown>]
Tags:
Description
In short, if I define an option like "-F", "--irs [OCTAL]"
, -i
will match this option, although the short version is defined as -F
.
In long, this can be quite troublesome:
See the provided example
http://ruby-doc.org/stdlib-2.2.0/libdoc/optparse/rdoc/OptionParser.html
and change or remove the "-i", "--inplace [EXTENSION]"
option for something else than i
:
Now, the -i will still match, but the other option "-F", "--irs [OCTAL]"
!
In a more complete stack this resulted in a hard to find error. Also, to fix this (and raise the required error) you need to check the ARGV directly which renders optparse a bit less useful.
Files
Actions