From: Nobuyoshi Nakada Date: 2007-05-25T15:19:18+09:00 Subject: Re: Ruby, OptionParser and multiple flags Hi, At Fri, 25 May 2007 01:13:54 +0900, LDC - Jairo Eduardo Lopez wrote in [ruby-talk:252822]: > ----- > ./script.rb -h -p > ----- > The script accepts -p as the argument for -h, which shouldn't happen as -p > is actually a flag. If -h can omit the argument, opts.on("-h [HOST]", "--host", String, "Especifica el servidor.", "Puede ser IP o DNS.") do |h| opciones.host = h end Else, if it must not start with "-", you can restrict it with a Regexp: opts.on("-h HOST", "--host", /[^-].*/, "Especifica el servidor.", "Puede ser IP o DNS.") do |h| opciones.host = h end /(?!-).+/ results same as above. -- Nobu Nakada