Module: RakeCommander::Options::Result
- Defined in:
- lib/rake-commander/options/result.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#options(argv = ARGV, &block) ⇒ Hash
Launches the options parsing of this class.
-
#options_leftovers ⇒ Object
The options part (so after
--
) that was NOT processed by theOptionParser
.
Instance Method Details
#options(argv = ARGV, &block) ⇒ Hash
Launches the options parsing of this class.
96 97 98 99 100 101 |
# File 'lib/rake-commander/options/result.rb', line 96 def (argv = ARGV, &block) return @options if instance_variable_defined?(:@options) @options = {} self.class.(argv, results: @options, leftovers: , &block) @options end |
#options_leftovers ⇒ Object
Note:
an unknown option (i.e. -f something
, --foo something
) would trigger an invalid option error.
This means that the leftovers
can only refer to arguments not paired to options that receive
parameters (i.e. --no-foo something
).
The options part (so after --
) that was NOT processed
by the OptionParser
. They are therefore unknown parameters.
108 109 110 |
# File 'lib/rake-commander/options/result.rb', line 108 def @options_leftovers ||= [] end |