File: trip-vgr

package info (click to toggle)
vasttrafik-cli 1.13-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 344 kB
  • sloc: python: 536; makefile: 50
file content (16 lines) | stat: -rw-r--r-- 426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
_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
    if [ $COMP_CWORD = 3 ]; then
        words="depart arrive"
    fi
    COMPREPLY=( $(compgen -W "${words}" -- ${cur}) )
    return 0
}

complete -F _trip_tab_complete trip-vgr