End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
OptionParser::List#update
update(sw, sopts, lopts, nsw = nil, nlopts = nil)
lib/optparse.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/optparse.rb, line 809
def update(sw, sopts, lopts, nsw = nil, nlopts = nil)
sopts.each {|o| @short[o] = sw} if sopts
lopts.each {|o| @long[o] = sw} if lopts
nlopts.each {|o| @long[o] = nsw} if nsw and nlopts
used = @short.invert.update(@long.invert)
@list.delete_if {|o| Switch === o and !used[o]}
end
Adds sw according to sopts, lopts and nlopts.
sw-
OptionParser::Switchinstance to be added. sopts-
Short style option list.
lopts-
Long style option list.
nlopts-
Negated long style options list.