Method: OptionParser::Arguable#getopts
- Defined in:
- lib/optparse.rb
#getopts(*args) ⇒ Object
Substitution of getopts is possible as follows. Also see OptionParser#getopts.
def getopts(*args)
($OPT = ARGV.getopts(*args)).each do |opt, val|
eval "$OPT_#{opt.gsub(/[^A-Za-z0-9_]/, '_')} = val"
end
rescue OptionParser::ParseError
end
2110 2111 2112 |
# File 'lib/optparse.rb', line 2110 def getopts(*args) .getopts(self, *args) end |