blob: 74453e332471bda7b1b0bedde5a44360b207ad15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
module Slop
# Base error class.
class Error < StandardError
end
# Raised when calling `call` on Slop::Option (this
# method must be overriden in subclasses)
class NotImplementedError < Error
end
# Raised when an option that expects an argument is
# executed without one. Suppress with the `suppress_errors`
# config option.
class MissingArgument < Error
attr_reader :flags;
# Get all the flags that matches
# the option with the missing argument
def initialize(msg, flags)
super(msg)
@flags = flags
end
end
# Raised when an unknown option is parsed. Suppress
# with the `suppress_errors` config option.
class UnknownOption < Error;
def initialize(msg, unknownOption)
super(msg)
@unknownOption = unknownOption
end
def getUnknowOption()
return @unknownOption
end
end
end
|