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=7c9314f502cde8daad23b61d10b24a542e04154a;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 - - - - - - - - - - -
- - - - - - - - - + - - - - -
ClassMCollective::Optionparser
In: - - lib/mcollective/optionparser.rb - -
-
Parent: - Object -
-
- + Class: MCollective::Optionparser -
+ + + + + - -
- -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Optionparser

+ +
+

A simple helper to build cli tools that supports a uniform command line layout.

-
- - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - -
parser [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

-Creates a new instance of the -parser, you can supply defaults and include named groups of options. +

+ + + + + + +
+

Attributes

+ + +
+ + +
+ parser[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(defaults = {}, include_sections = nil, exclude_sections = nil) + click to toggle source + +
+ +
+ +

+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")
 
-

[Source]

-
+ + + +
     # 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
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

+29: end +

+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + add_common_options() + click to toggle source + +
+ +
+ +

These options will be added to most cli tools

-

[Source]

-
+ + + +
      # 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
-
-
-
-
- -
- - - - -
-

+180: end +

+ +
+ + +
+ + +
+ + +
+ + add_filter_options() + click to toggle source + +
+ +
+ +

These options will be added if you pass ‘filter’ into the include list of the constructor.

-

[Source]

-
+ + + +
      # 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
-
-
-
-
- -
- - - - -
-

+109: end +

+ +
+ + +
+ + +
+ + +
+ + add_required_options() + click to toggle source + +
+ +
+ +

These options should always be present

-

[Source]

-
+ + + +
      # 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
-
-
-
-
- -
- - - - -
-

+125: end +

+ +
+ + +
+ + +
+ + +
+ + parse(&block) + click to toggle source + +
+ +
+ +

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

-

[Source]

-
+ + + +
     # 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
-
-
-
-
+69: end +
+ +
+ + +
+ + +
+ +
+

Private Instance Methods

+ + +
+ + +
+ + parse_fact(fact) + click to toggle source + +
+ +
+ +

+Parse a fact filter string like foo=bar into the tuple hash thats needed +

+ + +
+
+     # File lib/mcollective/optionparser.rb, line 184
+184:     def parse_fact(fact)
+185:       Util.parse_fact_string(fact)
+186:     end
+
+ +
-
+ +
+ +
+ -
+
-
-

[Validate]

-
+
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + +