X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=doc%2FMCollective%2FOptionparser.html;fp=doc%2Fclasses%2FMCollective%2FOptionparser.html;h=2a15570ece3180dda8f48ec09a96640c5624013a;hb=refs%2Fheads%2Fhavana;hp=946d0f2809053c7a57577783f7f9f0a5c33a0036;hpb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/classes/MCollective/Optionparser.html b/doc/MCollective/Optionparser.html similarity index 55% rename from doc/classes/MCollective/Optionparser.html rename to doc/MCollective/Optionparser.html index 946d0f2..2a15570 100644 --- a/doc/classes/MCollective/Optionparser.html +++ b/doc/MCollective/Optionparser.html @@ -1,150 +1,396 @@ - - - + +
-Class | -MCollective::Optionparser | -
In: | -
-
- lib/mcollective/optionparser.rb
-
- - |
-
Parent: | -- Object - | -
+ +
+ +A simple helper to build cli tools that supports a uniform command line layout.
-parser | -[R] | -- |
-Creates a new instance of the -parser, you can supply defaults and include named groups of options. +
+Creates a new instance of the parser, you can supply defaults and include +named groups of options.
Starts a parser that defaults to verbose and that includs the filter @@ -165,9 +411,11 @@ Starts a parser in verbose mode that does not show the common options:
oparser = MCollective::Optionparser.new({:verbose => true}, "filter", "common")- -
# File lib/mcollective/optionparser.rb, line 20 20: def initialize(defaults = {}, include_sections = nil, exclude_sections = nil) @@ -179,30 +427,42 @@ Starts a parser in verbose mode that does not show the common options: 26: @options = Util.default_options 27: 28: @options.merge!(defaults) -29: end --
These options will be added to most cli tools
- -# File lib/mcollective/optionparser.rb, line 128 128: def add_common_options @@ -257,29 +517,37 @@ These options will be added to most cli tools 177: @parser.on("--threaded", "Start publishing requests and receiving responses in threaded mode.") do |v| 178: @options[:threaded] = true 179: end -180: end --
These options will be added if you pass ‘filter’ into the include list of the constructor.
- -# File lib/mcollective/optionparser.rb, line 73 73: def add_filter_options @@ -318,28 +586,36 @@ include list of the constructor. 106: @parser.on('-I', '--wi', '--with-identity IDENT', 'Match hosts with a certain configured identity') do |a| 107: @options[:filter]["identity"] << a 108: end -109: end --
These options should always be present
- -# File lib/mcollective/optionparser.rb, line 112 112: def add_required_options @@ -355,23 +631,29 @@ These options should always be present 122: puts @parser 123: exit! 1 124: end -125: end --
Parse the options returning the options, you can pass a block that adds additional options to the Optionparser.
@@ -394,9 +676,11 @@ message specific to this app. Users can set default options that get parsed in using the MCOLLECTIVE_EXTRA_OPTS environemnt variable - -# File lib/mcollective/optionparser.rb, line 48 48: def parse(&block) @@ -420,22 +704,73 @@ MCOLLECTIVE_EXTRA_OPTS environemnt variable 66: @options[:collective] = Config.instance.main_collective unless @options[:collective] 67: 68: @options -69: end --
Disabled; run with --debug to generate this.
+ +Generated with the Darkfish + Rdoc Generator 1.1.6.
+