From: Keith Fahlgren Date: 2006-03-21T03:21:22+09:00 Subject: Re: I need some help with OptionsParser On Monday 20 March 2006 1:13 pm, bcorrigan78@gmail.com wrote: > Hey all, > > I must be doing something wrong here. Im calling the following file > this way: > ruby script.rb -s 1234 > or > ruby script.rb -s1111 > > #Code snip > require 'optparse' > opts = OptionParser.new > opts.on("-s", "--size VAL", Integer) do |val| > puts "-s #{val}" > puts val > end I think the "Integer" is unnecessary. Here's how I usually use it: opts.on("-p", "--prefix NAME", "REQUIRED: Set the prefix NAME (like 'ldpg').") {|p| $prefix = p} HTH, Keith