Exception: Trollop::CommandlineError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/trollop.rb

Overview

Thrown by Parser in the event of a commandline error. Not needed if you’re using the Trollop::options entry.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, error_code = nil) ⇒ CommandlineError

Returns a new instance of CommandlineError.



20
21
22
23
# File 'lib/trollop.rb', line 20

def initialize(msg, error_code = nil)
  super(msg)
  @error_code = error_code
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



18
19
20
# File 'lib/trollop.rb', line 18

def error_code
  @error_code
end