Hello,

I'd like to make an OptParser error look a bit more explanatory. I tried =
to deal with it outside OpiontParser like this:

----------------------------------------------------
# check if options[:no] is interger

if options[:no]=20
        begin
                $no =3D Integer(options[:no])
        rescue ArgumentError
                puts "#{$no} is not an Integer!"
        else
                true
        end    =20
else
        $no =3D 0
end
----------------------------------------------------
but didn't work. The error I get from cli is:

f2bread.rb:483:in `<main>': invalid argument: -s duck =
(OptionParser::InvalidArgument)

Apparently I need to somehow handle this from within OptionParser. Any =
ideas on how to proceed?  I found this post[1] online which explains =
what I want but I couldn't figure how exactly it works. So some actual =
codes with a sort of explanation of where *exactly* sits on the program =
(outside or inside "OptionParser.new" class?).

The relevant OptionParser lines, where is specified that '-n' accepts =
Integers, are:
----------------------------------------------------
 opts.on('-n', '--no N', Integer, 'Number of top entries to be =
displayed. By default all entries are displayed.') do |no|
                options[:no] =3D no
        end
----------------------------------------------------

[1] http://blog.segment7.net/2008/01/05/optionparser-argument-casting

Best Regards,

Panagiotis Atmatzidis
-----------------------------
Pharmacy Student at VFU

email4lists: 	ml / convalesco.org
More info: 	http://about.me/atmosx

The wise man said: "Never argue with an idiot, he brings you down to his =
level and beat you with experience."