# arch completion # _tla() { local cur commands COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} if [ $COMP_CWORD -eq 1 ]; then commands="$( tla help | grep ' : ' | cut -d ':' -f 1 | xargs echo )" COMPREPLY=( $( compgen -W "-h --help -H -V --version $commands" -- "$cur" ) ) return 0 fi _filedir return 0 } complete -F _tla tla