Exception: CommandOptionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/kwalify/util/option-parser.rb

Overview

$Rev$ $Release: 0.7.2 $ copyright© 2005-2010 kuwata-lab all rights reserved.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(option, error_symbol, message = nil) ⇒ CommandOptionError

Returns a new instance of CommandOptionError.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/kwalify/util/option-parser.rb', line 8

def initialize(option, error_symbol, message=nil)
  if !message
    case error_symbol
    when :no_argument
      message = "-%s: argument required." % option
    when :unknown_option
      message = "-%s: unknown option." % option
    when :invalid_property
      message = "-%s: invalid property." % option
    else
      message = "*** internal error(optchar=#{option}, error_symbol=#{error_symbol}) ***"
    end
  end
  super(message)
  @option = option
  @error_symbol = error_symbol
end

Instance Attribute Details

#error_symbolObject (readonly)

Returns the value of attribute error_symbol.



26
27
28
# File 'lib/kwalify/util/option-parser.rb', line 26

def error_symbol
  @error_symbol
end

#optionObject (readonly)

Returns the value of attribute option.



26
27
28
# File 'lib/kwalify/util/option-parser.rb', line 26

def option
  @option
end