Class: GLI::DefaultHelpCommand
- Inherits:
-
Command
- Object
- CommandLineToken
- Command
- GLI::DefaultHelpCommand
- Defined in:
- lib/support/help.rb
Instance Attribute Summary
Attributes inherited from CommandLineToken
Instance Method Summary collapse
- #execute(global_options, options, arguments) ⇒ Object
-
#initialize ⇒ DefaultHelpCommand
constructor
A new instance of DefaultHelpCommand.
Methods inherited from Command
#action, #arg_name, #clear_nexts, #default_value, #desc, #flag, #flags, name_as_string, #names, #switch, #switches, #usage
Methods inherited from CommandLineToken
Constructor Details
#initialize ⇒ DefaultHelpCommand
Returns a new instance of DefaultHelpCommand.
6 7 8 |
# File 'lib/support/help.rb', line 6 def initialize super(:help,'Shows list of commands or help for one command','[command]') end |
Instance Method Details
#execute(global_options, options, arguments) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/support/help.rb', line 10 def execute(,,arguments) if arguments.empty? list_global_flags list_commands else list_one_command_help(arguments[0]) end end |