Parses an options hash by calling any defined method by the same
 name of the key postfixed with an '='
 @param [Hash] options Options to parse.
430938
def parse_options(options={})
      options.each do |key, value|
        key = :"#{key}="
        self.send(key, value) if !value.nil? && self.respond_to?(key)
      end
    end
928284
def parse_options
      super(:raise_on_invalid_option => false, :parse_base_options => false) do |opts|

      opts.on("-T", "--tasks", "List tasks") do |t|
        options[:tasks] = t
      end

      opts.on("--bare", "List task names for CLI completion, implies '--tasks'") do |b|
        options[:bare] = b
        options[:tasks] = true if b
      end

      end
    end
989747
void parseOption(String option) {
    if (option.isEmpty()) {
      return;
    }

    @SuppressWarnings("StringSplitter")
    String[] keyAndValue = option.split(SPLIT_KEY_VALUE);
    requireArgument(keyAndValue.length <= 2,
        "key-value pair %s with more than one equals sign", option);

    String key = keyAndValue[0].trim();
    String value = (keyAndValue.length == 1) ? null : keyAndValue[1].trim();

    configure(key, value);
  }
1219987
def handle_options
      options.rakelib = ['rakelib']
      options.trace_output = $stderr

      OptionParser.new do |opts|
        opts.banner = "#{Rake.application.name} [-f rakefile] {options} targets..."
        opts.separator ""
        opts.separator "Options are ..."

        opts.on_tail("-h", "--help", "-H", "Display this help message.") do
          puts opts
          exit
        end

        standard_rake_options.each { |args| opts.on(*args) }
        opts.environment('RAKEOPT')
      end.parse!
    end
642207
def assert_valid_keys(hash, *valid_keys)
      unknown_keys = hash.keys - [valid_keys].flatten
      raise(ArgumentError, "Unsupported option(s) detected: #{unknown_keys.join(", ")}") unless unknown_keys.empty?
    end
1186396
function parseOptions(options) {
    return {
        boolean: "boolean" in options ? options.boolean : true,
        number: "number" in options ? options.number : true,
        string: "string" in options ? options.string : true,
        allow: options.allow || []
    };
}
864166
def parse_option(self, option, block_name, *values):
        

        if option.endswith('status'):
            status = values[0]
            if status not in self.VALID_STATUSES:
                raise ValueError(u'Invalid IM status "{0}"'.format(status))

            if len(values) > 2:
                raise TypeError

            if option == 'status':
                option = 'start_' + option

            key = option.split('_', 1)[0]
            self.statuses[key] = values[:2]

        elif option == 'status_msg':
            if len(values) != 2:
                raise TypeError

            name, msg = values
            self.messages[name] = msg
450493
def parse_options(options)
      options = Shellwords.split(options) unless options.is_a?(Array)
      parser = Thor::Options.new(self.class.class_options)
      parser.parse(options)
    end
601849
def call(name, given_options)
      # TODO: allow to receive rest of options/block in dynamic block. or, rather, test it as it was already implemented.
      evaluated_options = @dynamic_options.(name, given_options)

      options = Variables.merge( @static_options, handle_array_and_deprecate(evaluated_options) )
      options = Variables.merge( options, handle_array_and_deprecate(given_options) ) # FIXME: given_options is not tested!
    end
590181
def extract_options(names)
      options = {}
      options = names.pop if names.last.kind_of? Hash
      options = { :desc => @next_desc, 
                  :long_desc => @next_long_desc,
                  :default_value => @next_default_value,
                  :arg_name => @next_arg_name}.merge(options)
    end
526514
def to_hash(options = {})
      out = {}
      each_key do |k|
        assignment_key =
          if options[:stringify_keys]
            k.to_s
          elsif options[:symbolize_keys]
            k.to_s.to_sym
          else
            k
          end
        if self[k].is_a?(Array)
          out[assignment_key] ||= []
          self[k].each do |array_object|
            out[assignment_key] << maybe_convert_to_hash(array_object, options)
          end
        else
          out[assignment_key] = maybe_convert_to_hash(self[k], options)
        end
      end
      out
    end
47380
def parse_header(options = {})
      check_header
      @hdr = parse_basic_header
      @extended_header = parse_extended_header

      # Optional image gathering
      read_image if options[:image]
      get_image_narray(@image_rubyarray, @hdr['dim']) if options[:narray]

      @success = true
    end
1132683
def parse(args)
      @options = {}

      OptionParser.new do |parser|
        parser.banner = "Usage: #{APP_NAME} [options] [file1, file2, ...]"

        add_linter_options parser
        add_report_options parser
        add_file_options parser
        add_logger_options parser
        add_info_options parser
      end.parse!(args)

      # Any remaining arguments are assumed to be files
      @options[:files] = args.empty? ? ['.'] : args

      @options
    rescue OptionParser::InvalidOption => e
      raise Exceptions::InvalidCLIOption, e.message, e.backtrace
    end
1267627
def parse(data, options = {})

      return nil if data.nil? || data == ""
      json = get_json_structure(data, options)
      parse_json(json)

    end
135797
def load(key, options = {})
      @stack.each do |s|
        value = s.load(key, options)
        return value if value != nil
      end
      nil
    end
1166801
def parse_global_options
      parser = options.inject(OptionParser.new) do |options, option|
        options.on(*option[:args], &global_option_proc(option[:switches], &option[:proc]))
      end

      options = @args.dup
      begin
        parser.parse!(options)
      rescue OptionParser::InvalidOption => e
        # Remove the offending args and retry.
        options = options.reject { |o| e.args.include?(o) }
        retry
      end
    end
194752
def app_options
      if ambiguous?
        hash = {}
        @global_options.each_with_index do |option, i|
          hash[i] = option['name'] || option['root']
        end
        hash
      else
        {}
      end
    end