Method: OptionParser::List#prepend

Defined in:
lib/optparse.rb

#prepend(*args) ⇒ Object

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.

prepend(switch, short_opts, long_opts, nolong_opts)


902
903
904
905
# File 'lib/optparse.rb', line 902

def prepend(*args)
  update(*args)
  @list.unshift(args[0])
end