End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
OptionParser.new
new(banner = nil, width = 32, indent = ' ' * 4) { |self| ... }
lib/optparse.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/optparse.rb, line 1143
def initialize(banner = nil, width = 32, indent = ' ' * 4)
@stack = [DefaultList, List.new, List.new]
@program_name = nil
@banner = banner
@summary_width = width
@summary_indent = indent
@default_argv = ARGV
@require_exact = false
@raise_unknown = true
add_officious
yield self if block_given?
end
Initializes the instance and yields itself if called with a block.
banner-
Banner message.
width-
Summary width.
indent-
Summary indent.