Optparse behaviour

Hi!

I have some problems mit optparse (ruby-1.8.0).

I got the follwing script:

···

require 'optparse’
ARGV.options { |opts|
opts.on("-m=A", String) { |m| puts m }
opts.parse!
}

hostname:~/tmp$ ./r.rb -m a
a
hostname:~/tmp$ ./r.rb -M a
M
hostname:~/tmp$ ./r.rb -Ma
Ma

I think I shouldn’t be able to use ‘-M’ without an error message,
right?

Thanks,

chris

Hi,

···

At Wed, 5 Nov 2003 00:26:25 +0900, Christian von Mueffling wrote:

I got the follwing script:

require ‘optparse’
ARGV.options { |opts|
opts.on(“-m=A”, String) { |m| puts m }
opts.parse!
}

hostname:~/tmp$ ./r.rb -m a
a
hostname:~/tmp$ ./r.rb -M a
M
hostname:~/tmp$ ./r.rb -Ma
Ma

I think I shouldn’t be able to use ‘-M’ without an error message,
right?

Right, fixed now. Thank you.


Nobu Nakada