Class: GLI::Commands::Help
- Inherits:
-
GLI::Command
- Object
- GLI::CommandLineToken
- GLI::Command
- GLI::Commands::Help
- Defined in:
- lib/gli/commands/help.rb
Overview
The help command used for the two-level interactive help system
Instance Attribute Summary
Attributes included from GLI::CommandSupport
Attributes inherited from GLI::CommandLineToken
#aliases, #description, #long_description, #name
Instance Method Summary collapse
-
#initialize(app, output = $stdout, error = $stderr) ⇒ Help
constructor
A new instance of Help.
Methods inherited from GLI::Command
#action, #default_command, #default_desc, #has_option?, name_as_string
Methods included from GLI::CommandSupport
#arg_name, #arguments_description, #arguments_options, #commands, #commands_declaration_order, #context_description, #default_description, #default_value, #desc, #execute, #flag, #flags, #get_default_command, #has_action?, #long_desc, #names, #nodoc, #skips_around, #skips_post, #skips_pre, #switch, #switches, #topmost_ancestor, #usage
Methods included from DSL
#arg_name, #clear_nexts, #command, #default_value, #desc, #flag, #flags_declaration_order, #long_desc, #switch, #switches_declaration_order
Methods included from GLI::CopyOptionsToAliases
Methods inherited from GLI::CommandLineToken
Constructor Details
#initialize(app, output = $stdout, error = $stderr) ⇒ Help
Returns a new instance of Help.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/gli/commands/help.rb', line 33 def initialize(app,output=$stdout,error=$stderr) super(:names => :help, :description => 'Shows a list of commands or help for one command', :arguments_name => 'command', :long_desc => 'Gets help for the application or its commands. Can also list the commands in a way helpful to creating a bash-style completion function', :skips_pre => true, :skips_post => true, :skips_around => true) @app = app @sorter = SORTERS[@app.help_sort_type] @text_wrapping_class = WRAPPERS[@app.help_text_wrap_type] desc 'List commands one per line, to assist with shell completion' switch :c action do |,,arguments| show_help(,,arguments,output,error) end end |