I\'d like to be able to use ruby\'s OptionParser to parse sub-commands of the form
COMMAND [GLOBAL FLAGS] [SUB-COMMAND [SUB-COMMAND FLAGS]]
lik
It looks like the OptionParser syntax has changed some. I had to use the following so that the arguments array had all of the options not parsed by the opts object.
begin
opts.order!(arguments)
rescue OptionParser::InvalidOption => io
# Prepend the invalid option onto the arguments array
arguments = io.recover(arguments)
rescue => e
raise "Argument parsing failed: #{e.to_s()}"
end