Skip to content

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#append

append(*args)

Appends switch at the tail of the list, and associates short, long and negated long options. Arguments are:

switch

OptionParser::Switch instance to be inserted.

short_opts

List of short style options.

long_opts

List of long style options.

nolong_opts

List of long style options with “no-” prefix.

Example
append(switch, short_opts, long_opts, nolong_opts)
See also #accept #complete .new #each_option also in 3.3 · 3.2 · 3.1