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| ... }
lib/optparse.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/optparse.rb, line 2197
def options
@optparse ||= OptionParser.new
@optparse.default_argv = self
block_given? or return @optparse
begin
yield @optparse
rescue ParseError
@optparse.warn $!
nil
end
end
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.