'Add a new command or commands to this CmdSetcommand, a list of
commands or a cmdset to this cmdset. Note that this is *not*
a merge operation (that is handled by the + operator).
Args:
cmd (Command, list, Cmdset): This allows for adding one or
more commands to this Cmdset in one go. If another Cmdset
is given, all its commands will be added.
Notes:
If cmd already exists in set, it will replace the old one
(no priority checking etc happens here). This is very useful
when overloading default commands).
If cmd is another cmdset class or -instance, the commands of
that command set is added to this one, as if they were part of
the original cmdset definition. No merging or priority checks
are made, rather later added commands will simply replace
existing ones to make a unique set.'

def add(self, cmd):

    if inherits_from(cmd, 'evennia.commands.cmdset.CmdSet'):
        try:
            cmd = self._instantiate(cmd)
        except RuntimeError:
            string = 'Adding    cmdset    %(cmd)s    to    %(class)s    lead    to    an    '
            string += 'infinite    loop.    When    adding    a    cmdset    to    another,    '
            string += 'make    sure    they    are    not    themself    cyclically    added    to    '
            string += 'the    new    cmdset    somewhere    in    the    chain.'
            raise RuntimeError((_(string) % {'cmd': cmd, 'class': self.__class__}))
        cmds = cmd.commands
    elif is_iter(cmd):
        cmds = [self._instantiate(c) for c in cmd]
    else:
        cmds = [self._instantiate(cmd)]
    commands = self.commands
    system_commands = self.system_commands
    for cmd in cmds:
        if (not hasattr(cmd, 'obj')):
            cmd.obj = self.cmdsetobj
        try:
            ic = commands.index(cmd)
            commands[ic] = cmd
        except ValueError:
            commands.append(cmd)
        self.commands = list(set(commands))
        if cmd.key.startswith('__'):
            try:
                ic = system_commands.index(cmd)
                system_commands[ic] = cmd
            except ValueError:
                system_commands.append(cmd)
