class Thor::Options

def initialize(hash_options = {}, defaults = {}, stop_on_unknown = false)

an unknown option or a regular argument.
If +stop_on_unknown+ is true, #parse will stop as soon as it encounters

Takes a hash of Thor::Option and a hash with defaults.
def initialize(hash_options = {}, defaults = {}, stop_on_unknown = false)
  @stop_on_unknown = stop_on_unknown
  options = hash_options.values
  super(options)
  # Add defaults
  defaults.each do |key, value|
    @assigns[key.to_s] = value
    @non_assigned_required.delete(hash_options[key])
  end
  @shorts, @switches, @extra = {}, {}, []
  options.each do |option|
    @switches[option.switch_name] = option
    option.aliases.each do |short|
      name = short.to_s.sub(/^(?!\-)/, '-')
      @shorts[name] ||= option.switch_name
    end
  end
end