class method
OptionParser.new
(?::String banner, ?::Integer width, ?::String indent) ?{ (::OptionParser) -> void } -> ::OptionParser
new(banner = nil, width = 32, indent = ' ' * 4) { |self| ... }
lib/optparse.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/optparse.rb, line 1182
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.