Class: XOptionParser::Switch::FlagArgument

Inherits:
PlacedArgument
  • Object
show all
Defined in:
lib/xoptparse.rb

Instance Method Summary collapse

Instance Method Details

#parse(arg, argv, &error) ⇒ Object



246
247
248
249
250
251
252
# File 'lib/xoptparse.rb', line 246

def parse(arg, argv, &error)
  super(arg, argv, &error).tap do |val|
    raise OptionParser::InvalidArgument if val[0].nil? && val[2].nil?
  end
rescue OptionParser::InvalidArgument
  conv_arg(arg)
end