Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions lib/optparse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2314,42 +2314,42 @@ def message
# Raises when ambiguously completable string is encountered.
#
class AmbiguousOption < ParseError
const_set(:Reason, 'ambiguous option')
Reason = 'ambiguous option' # :nodoc:
end

#
# Raises when there is an argument for a switch which takes no argument.
#
class NeedlessArgument < ParseError
const_set(:Reason, 'needless argument')
Reason = 'needless argument' # :nodoc:
end

#
# Raises when a switch with mandatory argument has no argument.
#
class MissingArgument < ParseError
const_set(:Reason, 'missing argument')
Reason = 'missing argument' # :nodoc:
end

#
# Raises when switch is undefined.
#
class InvalidOption < ParseError
const_set(:Reason, 'invalid option')
Reason = 'invalid option' # :nodoc:
end

#
# Raises when the given argument does not match required format.
#
class InvalidArgument < ParseError
const_set(:Reason, 'invalid argument')
Reason = 'invalid argument' # :nodoc:
end

#
# Raises when the given argument word can't be completed uniquely.
#
class AmbiguousArgument < InvalidArgument
const_set(:Reason, 'ambiguous argument')
Reason = 'ambiguous argument' # :nodoc:
end

#
Expand Down Expand Up @@ -2448,9 +2448,11 @@ def initialize(*args) # :nodoc:
# and DecimalNumeric. See Acceptable argument classes (in source code).
#
module Acceptables
const_set(:DecimalInteger, OptionParser::DecimalInteger)
const_set(:OctalInteger, OptionParser::OctalInteger)
const_set(:DecimalNumeric, OptionParser::DecimalNumeric)
# :stopdoc:
DecimalInteger = OptionParser::DecimalInteger
OctalInteger = OptionParser::OctalInteger
DecimalNumeric = OptionParser::DecimalNumeric
# :startdoc:
end
end

Expand Down