We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
when I run the following code, I get
$ bundle exec ruby ./ecm.rb bar -v ecm: version unknown error: ecm: version unknown
It doesn't even print the defined version number. I was expecting to see error: Unknown option -v. Is this a bug?
error: Unknown option -v
It prints the version number if you put -v before the sub-command, as I expected:
-v
$ bundle exec ruby ./ecm.rb -v bar ecm.rb version 0.0.1
If a sub-command knows -v, you get it as a local option, as I expected:
$ bundle exec ruby ./ecm.rb foo -v globals: {"version"=>false, :version=>false, "help"=>false, :help=>false} options: {"v"=>true, :v=>true}
#!/usr/bin/env ruby require 'gli' include GLI::App program_desc 'A Command to test' version '0.0.1' subcommand_option_handling :normal arguments :strict desc 'foo command' command :foo do |c| c.desc 'Verbose' c.switch :v c.action do |global_options, options, args| puts "globals: #{global_options}" puts "options: #{options}" end end desc 'bar command' command :bar do |c| c.action do |global_options, options, args| puts "globals: #{global_options}" puts "options: #{options}" end end exit run(ARGV)
The text was updated successfully, but these errors were encountered:
Hmm, this does seem like a bug.
Sorry, something went wrong.
No branches or pull requests
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:The text was updated successfully, but these errors were encountered: