Robert Klemme
12/24/2008 11:55:00 AM
On 23.12.2008 21:40, Alan Partis wrote:
> Alan Partis wrote:
>> Can someone give me a little direction?
>
> Nevermind ... RTFM ... I just went back to pickaxe 3rd edition and found
> that the call to OptionParser.parse returns an array containing the
> remaining elements from ARGV that weren't processed as options.
And if you use parse! (which is what I generally do) the original array
is adjusted appropriately. This is important if you want to use ARGF
for example. My typical pattern is
OptionParser.new do |opts|
opts.on...
end.parse! ARGV
# now ARGV has only non args left
Kind regards
robert