Exception: Rootage::OptionError

Inherits:
Error
  • Object
show all
Defined in:
lib/rootage/exception.rb

Overview

OptionError is raised when the command option is invalid.

Direct Known Subclasses

Pione::Command::HideableOptionError

Instance Method Summary collapse

Constructor Details

#initialize(cmd, msg) ⇒ OptionError

Returns a new instance of OptionError.



10
11
12
13
# File 'lib/rootage/exception.rb', line 10

def initialize(cmd, msg)
  @cmd = cmd
  @msg = msg
end

Instance Method Details

#messageObject



15
16
17
# File 'lib/rootage/exception.rb', line 15

def message
  'Option error for "%{name}": %{msg}' % {name: @cmd.name, msg: @msg}
end