Exception: Cl::UnknownOption
Constant Summary collapse
- VALUE =
/=[^ ]*/
Constants inherited from Error
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
-
#opt ⇒ Object
readonly
Returns the value of attribute opt.
Instance Method Summary collapse
-
#initialize(cmd, str) ⇒ UnknownOption
constructor
A new instance of UnknownOption.
- #suggestions ⇒ Object
Constructor Details
#initialize(cmd, str) ⇒ UnknownOption
Returns a new instance of UnknownOption.
48 49 50 51 52 |
# File 'lib/cl/errors.rb', line 48 def initialize(cmd, str) @cmd = cmd @opt = str.sub('invalid option: ', '').sub(VALUE, '') super(:unknown_option, opt) end |
Instance Attribute Details
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
44 45 46 |
# File 'lib/cl/errors.rb', line 44 def cmd @cmd end |
#opt ⇒ Object (readonly)
Returns the value of attribute opt.
44 45 46 |
# File 'lib/cl/errors.rb', line 44 def opt @opt end |
Instance Method Details
#suggestions ⇒ Object
54 55 56 |
# File 'lib/cl/errors.rb', line 54 def suggestions cmd.suggestions(opt) end |