def list2str(cmd):
    """
    connect the string in list with space
    :param cmd: a list contains the command and flag
    :return: a string
    """
    ret = ""
    for i in range(len(cmd) - 1):
        ret += cmd[i] + " "
    ret += cmd[-1]
    print(ret)
    return ret