Class: MCollective::Application::Help

Inherits:
MCollective::Application show all
Defined in:
lib/mcollective/application/help.rb

Instance Method Summary collapse

Methods inherited from MCollective::Application

[], []=, #application_cli_arguments, #application_description, #application_failure, #application_options, application_options, #application_parse_options, #application_usage, #clioptions, #configuration, description, #disconnect, exclude_argument_sections, #halt, #halt_code, #help, intialize_application_options, option, #options, #rpcclient, #run, usage, #validate_cli_options, #validate_option

Methods included from RPC

const_missing, discovered, #empty_filter?, #printrpc, #printrpcstats, #rpcclient, #rpcoptions, stats

Instance Method Details

#mainObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mcollective/application/help.rb', line 10

def main
  if configuration.include?(:application)
    puts Applications[configuration[:application]].help
  else
    puts "The Marionette Collective version #{MCollective.version}"
    puts

    Applications.list.sort.each do |app|
      begin
        puts "  %-15s %s" % [app, Applications[app].application_description]
      rescue
      end
    end

    puts
  end
end

#post_option_parser(configuration) ⇒ Object



6
7
8
# File 'lib/mcollective/application/help.rb', line 6

def post_option_parser(configuration)
  configuration[:application] = ARGV.shift if ARGV.size > 0
end