Class: OptionParser
- Inherits:
-
Object
- Object
- OptionParser
- Defined in:
- lib/core_ext/option_parser.rb
Instance Method Summary collapse
-
#order_recognized!(args) ⇒ Object
Like order!, but leave any unrecognized –switches alone.
Instance Method Details
#order_recognized!(args) ⇒ Object
Like order!, but leave any unrecognized –switches alone
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/core_ext/option_parser.rb', line 4 def order_recognized!(args) extra_opts = [] begin order!(args) { |a| extra_opts << a } rescue OptionParser::InvalidOption => e extra_opts << e.args[0] retry end args[0, 0] = extra_opts end |