Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. 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.2 · 3.1 · 3.0