def create_bash_completion():

    db_file_path = get_dtf_data_dir() + "/main.db"
    completion_template = 'templates/completion_template.sh'
    completion_output = 'gen/dtf_bash_completion.sh'

    if isfile(completion_output):
        print "Completion output is already generated, skipping"
        return 0

    replacements = [('__REPLACE__', db_file_path)]

    if do_replace(completion_template, completion_output, replacements) != 0:

        print "Unable to perform updates to bash completion file!"
        return -1

    return 0
Generate a bash completion script based on current system
dataset/ETHPy150Open jakev/dtf/setup.py/create_bash_completion