Base class of exceptions from OptionParser.

Methods
I
M
N
R
S
T
Constants
Reason = 'parse error'.freeze
 

Reason which caused the error.

Attributes
[R] args
[W] reason
Class Public methods
new(*args)
# File lib/optparse.rb, line 1599
def initialize(*args)
  @args = args
  @reason = nil
end
Instance Public methods
inspect()
# File lib/optparse.rb, line 1631
def inspect
  "#<#{self.class.to_s}: #{args.join(' ')}>"
end
message()

Default stringizing method to emit standard error message.

Also aliased as: to_s
# File lib/optparse.rb, line 1638
def message
  reason + ': ' + args.join(' ')
end
reason()

Returns error reason. Override this for I18N.

# File lib/optparse.rb, line 1627
def reason
  @reason || self.class::Reason
end
recover(argv)

Pushes back erred argument(s) to argv.

# File lib/optparse.rb, line 1610
def recover(argv)
  argv[0, 0] = @args
  argv
end
set_option(opt, eq)
# File lib/optparse.rb, line 1615
def set_option(opt, eq)
  if eq
    @args[0] = opt
  else
    @args.unshift(opt)
  end
  self
end
to_s()