_{{prog_name}}_completion() {
    local IFS=$'\t'
    COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \
                   COMP_CWORD=$COMP_CWORD \
{%- for k, v in extra_env.items() %}
                   {{k}}={{v}} \
{%- endfor %}
                   {{complete_var}}=complete-bash $1 ) )
    return 0
}

complete -F _{{prog_name}}_completion -o default {{prog_name}}
