From: Ben Woodcroft Date: 2009-05-20T20:35:10+09:00 Subject: optparse: Arguments as Arguments Unexpectedness Hi, I am trying to use the standard optionparser to read in some arguments, but one of those arguments is an argument itself. Is this a bug? opt.rb: require 'optparse' OptionParser.new do |opts| opts.on('-a','--args [ARGUMENTS]',String,"arguments") {|v| puts "Found: #{v}"} end.parse! EXPECTED: $ ruby opt.rb -a "-d me" Found: -d me ACTUAL: $ ruby opt.rb -a "-d me" Found: /usr/lib/ruby/1.8/optparse.rb:1445:in `complete': invalid option: -d me (OptionParser::InvalidOption) from /usr/lib/ruby/1.8/optparse.rb:1443:in `catch' from /usr/lib/ruby/1.8/optparse.rb:1443:in `complete' from /usr/lib/ruby/1.8/optparse.rb:1282:in `parse_in_order' from /usr/lib/ruby/1.8/optparse.rb:1249:in `catch' from /usr/lib/ruby/1.8/optparse.rb:1249:in `parse_in_order' from /usr/lib/ruby/1.8/optparse.rb:1243:in `order!' from /usr/lib/ruby/1.8/optparse.rb:1334:in `permute!' from /usr/lib/ruby/1.8/optparse.rb:1355:in `parse!' from opt.rb:3 -- Posted via http://www.ruby-forum.com/.