In the following example if you call the command "init -n" and don't pass a value for "-n" GLI prints the main help for the entire application instead of printing the help for the command that was being called "init"
#!/usr/bin/env ruby
require 'gli'
require 'json'
include GLI::App
program_desc 'Describe your application here'
version Testit::VERSION
subcommand_option_handling :normal
arguments :strict
command :init do |c|
c.flag :n,
:type => String,
:desc => 'Name',
:required => true
c.action do |_, _, _|
puts "test"
end
end
In the following example if you call the command "init -n" and don't pass a value for "-n" GLI prints the main help for the entire application instead of printing the help for the command that was being called "init"