diff options
-rw-r--r-- | bash_completion.pbuilder | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/bash_completion.pbuilder b/bash_completion.pbuilder index 9f4fac4..1338411 100644 --- a/bash_completion.pbuilder +++ b/bash_completion.pbuilder @@ -10,21 +10,17 @@ have pbuilder && _pbuilder() { - local cur prev options + local cur options COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} - prev=${COMP_WORDS[COMP_CWORD-1]} options='--create --update --build --login --execute --dumpconfig' - case $prev in - --build) - COMPREPLY=( $( compgen -o filenames -G "$cur*.dsc" ) ) - ;; - *) - COMPREPLY=( $( compgen -W "$options" | grep "^$cur" ) ) - ;; - esac + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $( compgen -W "$options" | grep "^$cur" ) ) + elif [ "${COMP_WORDS[1]}" = --build ]; then + COMPREPLY=( $( compgen -o filenames -G "$cur*.dsc" ) ) + fi return 0 } |