def register_command(self, name, command):
        """
        Registers the `command` with the given `name`.

        If the `name` has already been used to register a command a
        :exc:`RuntimeError` will be raised.
        """
        if name in self.commands:
            raise RuntimeError('%s is already defined' % name)
        self.commands[name] = command
Registers the `command` with the given `name`.

        If the `name` has already been used to register a command a
        :exc:`RuntimeError` will be raised.