'Define extended command'

def func(self):

    caller = self.caller
    location = caller.location
    if (self.cmdstring == '@detail'):
        if (not location):
            caller.msg('No    location    to    detail!')
            return
        if (location.db.details is None):
            caller.msg('|rThis    location    does    not    support    details.|n')
            return
        if (self.switches and (self.switches[0] in 'del')):
            if (self.lhs in location.db.details):
                del location.db.details[self.lhs]
            caller.msg(('Detail    %s    deleted,    if    it    existed.' % self.lhs))
            self.reset_times(location)
            return
        if (not self.args):
            string = ('|wDetails    on    %s|n:' % location)
            details = '\n'.join((('    |w%s|n:    %s' % (key, utils.crop(text))) for (key, text) in location.db.details.items()))
            caller.msg((('%s\n%s' % (string, details)) if details else ('%s    None.' % string)))
            return
        if (not self.rhs):
            if (self.args in location.db.details):
                string = ("|wDetail    '%s'    on    %s:\n|n" % (self.args, location))
                string += str(location.db.details[self.args])
                caller.msg(string)
            else:
                caller.msg(("Detail    '%s'    not    found." % self.args))
            return
        location.db.details[self.lhs] = self.rhs
        caller.msg(("Set    Detail    %s    to    '%s'." % (self.lhs, self.rhs)))
        self.reset_times(location)
        return
    else:
        if (not self.args):
            if location:
                string = ('|wDescriptions    on    %s|n:\n' % location.key)
                string += ('    |wspring:|n    %s\n' % location.db.spring_desc)
                string += ('    |wsummer:|n    %s\n' % location.db.summer_desc)
                string += ('    |wautumn:|n    %s\n' % location.db.autumn_desc)
                string += ('    |wwinter:|n    %s\n' % location.db.winter_desc)
                string += ('    |wgeneral:|n    %s' % location.db.general_desc)
                caller.msg(string)
                return
        if (self.switches and (self.switches[0] in ('spring', 'summer', 'autumn', 'winter'))):
            if self.rhs:
                caller.msg('Seasonal    descs    only    work    with    rooms,    not    objects.')
                return
            switch = self.switches[0]
            if (not location):
                caller.msg('No    location    was    found!')
                return
            if (switch == 'spring'):
                location.db.spring_desc = self.args
            elif (switch == 'summer'):
                location.db.summer_desc = self.args
            elif (switch == 'autumn'):
                location.db.autumn_desc = self.args
            elif (switch == 'winter'):
                location.db.winter_desc = self.args
            self.reset_times(location)
            caller.msg(('Seasonal    description    was    set    on    %s.' % location.key))
        else:
            if self.rhs:
                text = self.rhs
                obj = caller.search(self.lhs)
                if (not obj):
                    return
            else:
                text = self.args
                obj = location
            obj.db.desc = text
            if obj.attributes.has('general_desc'):
                obj.db.general_desc = text
                self.reset_times(obj)
                caller.msg(('General    description    was    set    on    %s.' % obj.key))
            else:
                caller.msg(('The    description    was    set    on    %s.' % obj.key))
