summaryrefslogtreecommitdiff
path: root/completions/apt-build
diff options
context:
space:
mode:
Diffstat (limited to 'completions/apt-build')
-rw-r--r--completions/apt-build25
1 files changed, 9 insertions, 16 deletions
diff --git a/completions/apt-build b/completions/apt-build
index d875a986..aa78b230 100644
--- a/completions/apt-build
+++ b/completions/apt-build
@@ -1,16 +1,14 @@
-# Debian apt-build(1) completion.
+# Debian apt-build(1) completion -*- shell-script -*-
-have apt-build &&
_apt_build()
{
- local cur prev special i
+ local cur prev words cword
+ _init_completion || return
- COMPREPLY=()
- _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
- special=${COMP_WORDS[i]}
+ local special i
+ for (( i=0; i < ${#words[@]}-1; i++ )); do
+ if [[ ${words[i]} == @(install|remove|source|info|clean) ]]; then
+ special=${words[i]}
fi
done
@@ -21,7 +19,8 @@ _apt_build()
return 0
;;
remove)
- COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
+ COMPREPLY=( \
+ $( _xfunc dpkg _comp_dpkg_installed_packages "$cur" ) )
return 0
;;
*)
@@ -57,10 +56,4 @@ _apt_build()
} &&
complete -F _apt_build apt-build
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
# ex: ts=4 sw=4 et filetype=sh