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

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

complete -F _stops_tab_complete stops
