Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

OptionParser::List#prepend

prepend(*args)

Inserts switch at the head 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
prepend(switch, short_opts, long_opts, nolong_opts)