'This performs the actual command.'

def func(self):

    if (not self.args):
        self.caller.msg('Usage:    wear    <obj>    [wear    style]')
        return
    clothing = self.caller.search(self.arglist[0], candidates=self.caller.contents)
    wearstyle = True
    if (not clothing):
        return
    if (not clothing.is_typeclass('evennia.contrib.clothing.Clothing')):
        self.caller.msg("That's    not    clothes!")
        return
    if (CLOTHING_OVERALL_LIMIT and (len(get_worn_clothes(self.caller)) >= CLOTHING_OVERALL_LIMIT)):
        self.caller.msg("You    can't    wear    any    more    clothes.")
        return
    if (clothing.db.clothing_type and (not clothing.db.worn)):
        type_count = single_type_count(get_worn_clothes(self.caller), clothing.db.clothing_type)
        if (clothing.db.clothing_type in CLOTHING_TYPE_LIMIT.keys()):
            if (type_count >= CLOTHING_TYPE_LIMIT[clothing.db.clothing_type]):
                self.caller.msg(("You    can't    wear    any    more    clothes    of    the    type    '%s'." % clothing.db.clothing_type))
                return
    if (clothing.db.worn and (len(self.arglist) == 1)):
        self.caller.msg(("You're    already    wearing    %s!" % clothing.name))
        return
    if (len(self.arglist) > 1):
        wearstyle_list = self.arglist
        del wearstyle_list[0]
        wearstring = '    '.join((str(e) for e in wearstyle_list))
        if (WEARSTYLE_MAXLENGTH and (len(wearstring) > WEARSTYLE_MAXLENGTH)):
            self.caller.msg(('Please    keep    your    wear    style    message    to    less    than    %i    characters.' % WEARSTYLE_MAXLENGTH))
        else:
            wearstyle = wearstring
    clothing.wear(self.caller, wearstyle)
