summaryrefslogtreecommitdiff
path: root/contrib/apt-build
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/apt-build')
-rw-r--r--contrib/apt-build13
1 files changed, 6 insertions, 7 deletions
diff --git a/contrib/apt-build b/contrib/apt-build
index 6031d61f..9597ae8d 100644
--- a/contrib/apt-build
+++ b/contrib/apt-build
@@ -6,8 +6,7 @@ _apt_build()
local cur prev special i
COMPREPLY=()
- cur=`_get_cword`
- prev=${COMP_WORDS[COMP_CWORD-1]}
+ _get_comp_words_by_ref cur prev
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
if [[ ${COMP_WORDS[i]} == @(install|remove|source|info|clean) ]]; then
@@ -17,7 +16,7 @@ _apt_build()
if [ -n "$special" ]; then
case $special in
- @(install|source|info))
+ install|source|info)
COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null ) )
return 0
;;
@@ -31,12 +30,12 @@ _apt_build()
esac
fi
- case "$prev" in
- --@(patch|build-dir|repository-dir))
+ case $prev in
+ --patch|--build-dir|--repository-dir)
_filedir
return 0
;;
- -@(h|-help))
+ -h|--help)
return 0
;;
esac
@@ -56,7 +55,7 @@ _apt_build()
return 0
} &&
-complete -F _apt_build $filenames apt-build
+complete -F _apt_build -o filenames apt-build
# Local variables:
# mode: shell-script