Exception: Cl::UnknownOption

Inherits:
Error
  • Object
show all
Defined in:
lib/cl/errors.rb

Constant Summary

Constants inherited from Error

Error::MSGS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd, str) ⇒ UnknownOption

Returns a new instance of UnknownOption.



45
46
47
48
49
# File 'lib/cl/errors.rb', line 45

def initialize(cmd, str)
  @cmd = cmd
  @opt = str.sub('invalid option: ', '')
  super(:unknown_option, opt)
end

Instance Attribute Details

#cmdObject (readonly)

Returns the value of attribute cmd.



43
44
45
# File 'lib/cl/errors.rb', line 43

def cmd
  @cmd
end

#optObject (readonly)

Returns the value of attribute opt.



43
44
45
# File 'lib/cl/errors.rb', line 43

def opt
  @opt
end

Instance Method Details

#suggestionsObject



51
52
53
# File 'lib/cl/errors.rb', line 51

def suggestions
  cmd.suggestions(opt)
end