[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

optparse behaviour

Christian von Mueffling

11/4/2003 3:26:00 PM

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

1 Answer

nobu.nokada

11/6/2003 2:05:00 AM

0

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