def build_vistrails_cmd_line_db(path_to_vistrails, path_to_python,
                                env_for_vistrails, host, 
                                db_name, db_user, vt_id, version, port, 
                                path_to_figures, pdf=False, wgraph=False, 
                                tree=False):
    #dump pdf
    if pdf:
        pdfoption = ["--graphs-as-pdf"]
    else:
        pdfoption = []
    #user
    if db_user is not None and db_user != "":
        useroption = ['-u', '%s'%db_user]
    else:
        useroption = []
    #dump tree and workflow graph
    if wgraph:
        graphoption = ['-E', '--output-pipeline-graph', '-o', '%s'%os.path.abspath(path_to_figures)] + pdfoption
    elif tree:
        graphoption = ['-E', '--output-version-tree', '-o', '%s'%os.path.abspath(path_to_figures)] + pdfoption
    else:
        graphoption = ['-p', 'file.dir=%s'%os.path.abspath(path_to_figures)]
    #don't select a workflow
    if version is not None:
        voption = ":%s"%version
    else:
        voption = ""
        
    prefix = ['%s'%path_to_vistrails]
    if path_to_vistrails.endswith(".py"):
        prefix = ['%s'%path_to_python,
                  '%s'%path_to_vistrails]
    cmd_line = prefix + ['-b'] + graphoption + ['-t', host, '-f',db_name] + \
             useroption + ['-r', port] + [ '%s%s'%(vt_id, voption)]
    return cmd_line

###############################################################################
build_vistrails_cmd_line_db(path_to_vistrails: str, env_for_vistrails: str,
dataset/ETHPy150Open VisTrails/VisTrails/extensions/latex/includevistrail.py/build_vistrails_cmd_line_db