Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OptionParser::Arguable#options

options() { |optparse| ... }

Actual OptionParser object, automatically created if nonexistent.

If called with a block, yields the OptionParser object and returns the result of the block. If an OptionParser::ParseError exception occurs in the block, it is rescued, a error message printed to STDERR and nil returned.

See also #options= #getopts .new #order! also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1