# Bash completion for the qcd() function # Copyright © 2016 Teddy Wing # This file is licensed under the GNU GPLv3+. Please see COPYING # for more information. _qcd () { local cur local shortcuts=$(awk '{ print $1 }' $QCD_DATABASE_FILE) COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} case "$COMP_CWORD" in 1|2) COMPREPLY=( $( compgen -W "$shortcuts" -- $cur ) ) ;; 3) COMPREPLY=() ;; esac return 0 } complete -o default -F _qcd qcd