Method code for $builder.destroy_cmd()

[Turn on line numbering]
arg cmdstr, cmd, objs;
var name, ans, obj, fail;

(> .perms(caller(), 'command) <);
cmd = cmd.trim();
for obj in (filter obj in (objs) where (obj.is($user))) {
    .tell("You shouldn't @destroy users (" + obj.name() + "), use @reap.");
    fail++;
}
if (fail) {
    .tell("Destroying a user directly may not cleanup everything properly.");
    .tell("Objects managed by the user will be given to $reaper.");
    ans = (> .prompt("Given this information, do you want to continue? [no] ") <);
    if (!(ans in ["y", "yes"]))
        return "Ok, aborting..";
}
for obj in (objs) {
    catch any {
        name = obj.namef('xref);
        (> obj.destroy() <);
        if (valid(obj))
            .tell("Unable to destroy " + name + " immediately.");
        else
            .tell("Successfully destroyed " + name + ".");
    } with {
        return traceback()[1][2];
    }
}

["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]

the Cold Dark