Method: OptionParser#order
- Defined in:
- lib/optparse.rb
#order(*argv, into: nil, &nonopt) ⇒ Object
Parses command line arguments argv in order. When a block is given, each non-option argument is yielded. When optional into keyword argument is provided, the parsed option values are stored there via []= method (so it can be Hash, or OpenStruct, or other similar object).
Returns the rest of argv left unparsed.
1558 1559 1560 1561 |
# File 'lib/optparse.rb', line 1558 def order(*argv, into: nil, &nonopt) argv = argv[0].dup if argv.size == 1 and Array === argv[0] order!(argv, into: into, &nonopt) end |