def command_exists(command):
    """ Check if the given command was registered. In another words if it
    exists.
    """
    for category, commands in iteritems(command_categories):
        for existing_command in commands:
            if existing_command.match(command):
                return True
    return False