_trip_tab_complete() {
    local cur
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"

    if ([ $COMP_CWORD = 1 ] || [ $COMP_CWORD = 2 ]) && [ -e ~/.cache/vasttrafik-cli-stops ]; then
        words=$(cat ~/.cache/vasttrafik-cli-stops)
    fi
    COMPREPLY=( $(compgen -W "${words}" -- ${cur}) )
    return 0
}

complete -F _trip_tab_complete trip
