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