Class: Bogo::Cli::Parser::OptionParser
- Inherits:
-
OptionParser
- Object
- OptionParser
- Bogo::Cli::Parser::OptionParser
- Defined in:
- lib/bogo-cli/parser.rb
Overview
Modified option parser to include subcommand information
Instance Attribute Summary collapse
-
#subcommands ⇒ Object
Returns the value of attribute subcommands.
Instance Method Summary collapse
Instance Attribute Details
#subcommands ⇒ Object
Returns the value of attribute subcommands.
81 82 83 |
# File 'lib/bogo-cli/parser.rb', line 81 def subcommands @subcommands end |
Instance Method Details
#help ⇒ Object
83 84 85 86 87 88 89 90 91 |
# File 'lib/bogo-cli/parser.rb', line 83 def help v = super return v if Array(subcommands).empty? v += "\n" + "Available Commands:\n\n" Array(subcommands).each do |sc| v += summary_indent + sc.name.to_s + "\t" + sc.description.to_s + "\n" end v + "\n" + 'See `<command> --help` for more information on a specific command.' end |