Open yashi opened 6 years ago
Hmm, this does seem like a bug.
This may not be easily fixable. The problem is that GLI is using the standard library OptionParser
under the hood. It hard-codes --version
and interprets -v
as --version
. What's happening is that when you run bundle exec ruby ./ecm.rb bar -v
, since bar
does not accept -v
, that is getting passed to the OptionParser
as --version
, which uses OptionParser
's internal version that GLI doesn't use.
That's all fine, except that OptionParser
is calling exit
instead of raising an exception.
I'm leaving this open as documentation, but I'm not sure how to fix it.
Hi,
when I run the following code, I get
It doesn't even print the defined version number. I was expecting to see
error: Unknown option -v
. Is this a bug?It prints the version number if you put
-v
before the sub-command, as I expected:If a sub-command knows
-v
, you get it as a local option, as I expected: