| Class | MCollective::Application |
| In: |
lib/mcollective/application.rb
|
| Parent: | Object |
Sets the application description, there can be only one description per application so multiple calls will just change the description
Wrapper to create command line options
- name: varaible name that will be used to access the option value
- description: textual info shown in --help
- arguments: a list of possible arguments that can be used
to activate this option
- type: a data type that ObjectParser understand of :bool or :array
- required: true or false if this option has to be supplied
- validate: a proc that will be called with the value used to validate
the supplied value
option :foo,
:description => "The foo option"
:arguments => ["--foo ARG"]
after this the value supplied will be in configuration[:foo]
Handles failure, if we‘re far enough in the initialization phase it will log backtraces if its in verbose mode only
Creates a standard options hash, pass in a block to add extra headings etc see Optionparser
A helper that creates a consistent exit code for applications by looking at an instance of MCollective::RPC::Stats
Exit with 0 if nodes were discovered and all passed Exit with 0 if no discovery were done and > 0 responses were received, all ok Exit with 1 if no nodes were discovered Exit with 2 if nodes were discovered but some RPC requests failed Exit with 3 if nodes were discovered, but no responses received Exit with 4 if no discovery were done and no responses were received
Fake abstract class that logs if the user tries to use an application without supplying a main override method.
Wrapper around MC::RPC#rpcclient that forcably supplies our options hash if someone forgets to pass in options in an application the filters and other cli options wouldnt take effect which could have a disasterous outcome
The main logic loop, builds up the options, validate configuration and calls the main as supplied by the user. Disconnects when done and pass any exception onto the application_failure helper
Calls the supplied block in an option for validation, an error raised will log to STDERR and exit the application