From: ggarramuno@... (GGarramuno) Date: 2004-07-13T10:07:23+09:00 Subject: Re: OptionParser question Suggestion: do not use OptionParser. Download and install my port of Damian Conway's Getopt::Declare (at rubyforge.net). You can then just write code as simple as: require "Getopt/Declare" args = Getopt::Declare.new(<<'EOPARAM') [pvtype: cmd /start|stop/ ] -maintenance Go into maintenance mode Begin/Stop script [required] Use start or stop. EOPARAM print args.inspect ------------------------------------------------- > test.rb Error: required parameter '' not found. (try 'C:/ruby/learning/test.rb -help' for more information) > test.rb -h test.rb: version dated Mon Jul 12 21:55:16 Hora est. de Sudam�rica E. 2004 Usage: test.rb [options] test.rb -help test.rb -version Options: -maintenance Go into maintenance mode Begin/Stop script Use start or stop. > test.rb start => "start" Unused: > test.rb -maintenance start => "start" -maintenance => "-maintenance" Unused: