def self.create(name, desc="", opts={}, settings={})
opttype = Trollop::Parser.registry_getopttype(opts[:type])
opttype_from_default = get_klass_from_default(opts, opttype)
raise ArgumentError, ":type specification and default type don't match (default type is #{opttype_from_default.class})" if opttype && opttype_from_default && (opttype.class != opttype_from_default.class)
opt_inst = (opttype || opttype_from_default || Trollop::BooleanOption.new)
opt_inst.long = handle_long_opt(opts[:long], name)
opt_inst.short = handle_short_opt(opts[:short])
multi_given = opts[:multi] || false
opt_inst.multi_given = multi_given
defvalue = opts[:default] || opt_inst.default
defvalue = [defvalue] if defvalue && multi_given && !defvalue.kind_of?(Array)
opt_inst.default = defvalue
opt_inst.name = name
opt_inst.opts = opts
opt_inst
end