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.
47 48 49 50 51 |
# File 'lib/cl/errors.rb', line 47 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.
43 44 45 |
# File 'lib/cl/errors.rb', line 43 def cmd @cmd end |
#opt ⇒ Object (readonly)
Returns the value of attribute opt.
43 44 45 |
# File 'lib/cl/errors.rb', line 43 def opt @opt end |
Instance Method Details
#suggestions ⇒ Object
53 54 55 |
# File 'lib/cl/errors.rb', line 53 def suggestions cmd.suggestions(opt) end |