lib/subcommand.rb
# this is so that on pressing --help he gets same subcommand help as when doing help.
# This is to be added in your main program, after defining global options
# if you want detailed help on --help. This is since optionparser's default
# --help will not print your actions/commands
this is so that on pressing --help he gets same subcommand help as when doing help.
This is to be added in your main program, after defining global options
if you want detailed help on --help. This is since optionparser's default
help will not print your actions/commands
this is so that on pressing -- help he gets same subcommand help as when doing help . This is to be added in your main program after defining global options if you want detailed help on -- help . This is since optionparser ' s default help will not print your actions / commands
def add_help_option
    global_options do |opts|
      opts.on("-h", "--help", "Print this help") do |v|
        add_subcommand_help
        puts @global
        exit
      end
    end
  end
def add_help_option global_options do | opts | opts . on ( "-h" , "--help" , "Print this help" ) do | v | add_subcommand_help puts @global exit end end end
this is so that on pressing --help he gets same subcommand help as when doing help.
this is so that on pressing -- help he gets same subcommand help as when doing help .