class IDL::OptionList

def define_switch(switch, options = {}, &block)

def define_switch(switch, options = {}, &block)
  switch = switch.to_s
  raise "switch types mismatch" if @options.has_key?(switch) && options[:type] && options[:type] != @options[switch].type
  @options[switch] ||= Option.new(switch, options)
  block.call(Option::Configurator.new(@options[switch])) if block_given?
end