'Implements the command.'

def func(self):

    caller = self.caller
    if ((not self.args) or (not self.lhslist)):
        caller.msg('Usage:    @destroy[/switches]    [obj,    obj2,    obj3,    [dbref-dbref],...]')
        return ''
    def delobj(objname, byref=False):
        string = ''
        obj = caller.search(objname)
        if (not obj):
            self.caller.msg('    (Objects    to    destroy    must    either    be    local    or    specified    with    a    unique    #dbref.)')
            return ''
        objname = obj.name
        if (not (obj.access(caller, 'control') or obj.access(caller, 'delete'))):
            return ("\nYou    don't    have    permission    to    delete    %s." % objname)
        if (obj.player and (not ('override' in self.switches))):
            return ('\nObject    %s    is    controlled    by    an    active    player.    Use    /override    to    delete    anyway.' % objname)
        if (obj.dbid == int(settings.DEFAULT_HOME.lstrip('#'))):
            return ('\nYou    are    trying    to    delete    |c%s|n,    which    is    set    as    DEFAULT_HOME.    Re-point    settings.DEFAULT_HOME    to    another    object    before    continuing.' % objname)
        had_exits = (hasattr(obj, 'exits') and obj.exits)
        had_objs = (hasattr(obj, 'contents') and any((obj for obj in obj.contents if (not (hasattr(obj, 'exits') and (obj not in obj.exits))))))
        okay = obj.delete()
        if (not okay):
            string += ('\nERROR:    %s    not    deleted,    probably    because    delete()    returned    False.' % objname)
        else:
            string += ('\n%s    was    destroyed.' % objname)
            if had_exits:
                string += ('    Exits    to    and    from    %s    were    destroyed    as    well.' % objname)
            if had_objs:
                string += ('    Objects    inside    %s    were    moved    to    their    homes.' % objname)
        return string
    result = []
    for objname in self.lhslist:
        if ('-' in objname):
            (dmin, dmax) = [utils.dbref(part, reqhash=False) for part in objname.split('-', 1)]
            if (dmin and dmax):
                for dbref in range(int(dmin), int((dmax + 1))):
                    result.append(delobj(('#' + str(dbref)), True))
            else:
                result.append(delobj(objname))
        else:
            result.append(delobj(objname, True))
    if result:
        caller.msg(''.join(result).strip())
