lib/fig/command/options/parser.rb
# This class knows way too much about how OptionParser works.
This class knows way too much about how OptionParser works.
This class knows way too much about how OptionParser works .
def raise_invalid_argument(option, value, description = nil)
        fig --set --get FOO
     it assigns "--get" as the value of the "--set" option.
    if @switches.has_key? value
      raise_missing_argument(option)
    end
    description ||= @argument_description[option]
    if description.nil?
      description = ''
    else
      description = ' ' + description
    end
    raise Fig::Command::OptionError.new(
      %Q<Invalid value for {option}: "{value}"{description}>
    )
  end
def raise_invalid_argument ( option , value , description = nil ) if @switches . has_key? value raise_missing_argument ( option ) end description ||= @argument_description [ option ] if description . nil? description = '' else description = ' ' + description end raise Fig :: Command :: OptionError . new ( %Q<Invalid value for #{option}: "#{value}"#{description}> ) end
This class knows way too much about how OptionParser works.
This class knows way too much about how OptionParser works .
# *sigh* OptionParser does not raise MissingArgument for the case of an # option with a required value being followed by another option.  It # assigns the next option as the value instead.  E.g. for # #    fig --set --get FOO # # it assigns "--get" as the value of the "--set" option.
option
value
description