aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@ftbfs.org>2009-11-09 03:04:49 -0800
committerMatt Kraai <kraai@ftbfs.org>2009-11-09 03:08:42 -0800
commit57e6474dededeb9580ac41c9c1649fb5e9bd75ef (patch)
treeee8c9abc67480a128e7ea3025e9d859f6816f8d5
parent8e4703290a5d880ef4db93786c9e8eac2f890636 (diff)
downloadpbuilder-57e6474dededeb9580ac41c9c1649fb5e9bd75ef.tar
pbuilder-57e6474dededeb9580ac41c9c1649fb5e9bd75ef.tar.gz
complete filenames correctly if options are used. (closes: #555214)
-rw-r--r--bash_completion.pbuilder16
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
}