Class: MCollective::Application::Help

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

Overview

rubocop:disable Style/ClassAndModuleChildren

Instance Attribute Summary

Attributes inherited from MCollective::Application

#options

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, external, external_help, #external_help, #external_main, #halt, #halt_code, #help, intialize_application_options, option, #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 # rubocop:disable Lint/SuppressedException
      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 unless ARGV.empty?
end