summaryrefslogtreecommitdiff
path: root/completions/dpkg
diff options
context:
space:
mode:
Diffstat (limited to 'completions/dpkg')
-rw-r--r--completions/dpkg42
1 files changed, 20 insertions, 22 deletions
diff --git a/completions/dpkg b/completions/dpkg
index 76dd5b01..827d9cad 100644
--- a/completions/dpkg
+++ b/completions/dpkg
@@ -3,7 +3,7 @@
_have grep-status && {
_comp_dpkg_installed_packages()
{
- grep-status -P -e "^$1" -a -FStatus 'install ok installed' -n -s Package
+ grep-status -P -e "^$1" -a -FStatus 'ok installed' -n -s Package
}
} || {
_comp_dpkg_installed_packages()
@@ -19,7 +19,7 @@ _comp_dpkg_installed_packages()
_have grep-status && {
_comp_dpkg_purgeable_packages()
{
- grep-status -P -e "^$1" -a -FStatus 'install ok installed' -o -FStatus 'deinstall ok config-files' -n -s Package
+ grep-status -P -e "^$1" -a -FStatus 'ok installed' -o -FStatus 'ok config-files' -n -s Package
}
} || {
_comp_dpkg_purgeable_packages()
@@ -44,43 +44,41 @@ _dpkg()
# find the last option flag
if [[ $cur != -* ]]; then
while [[ $prev != -* && $i -ne 1 ]]; do
- i=$((i-1))
- prev=${words[i-1]}
+ prev=${words[--i - 1]}
done
fi
case $prev in
- -c|-i|-A|-I|-f|-e|-x|-W|--install|--unpack|--record-avail| \
- --contents|--info|--fsys-tarfile|--field|--control|--extract| \
- --vextract)
+ --install|--unpack|--record-avail|--contents|--info|--fsys-tarfile|\
+ --field|--control|--extract|--vextract|-!(-*)[ciAIfexW])
_filedir '?(u|d)deb'
return
;;
- -b|--build)
+ --build|-!(-*)b)
_filedir -d
return
;;
- -s|-p|-l|-W|--status|--print-avail|--list|--show)
- COMPREPLY=( $( apt-cache pkgnames "$cur" 2>/dev/null ) )
+ --status|--print-avail|--list|--show|-!(-*)[splW])
+ COMPREPLY=( $(apt-cache pkgnames "$cur" 2>/dev/null) )
return
;;
- -S|--search)
+ --search|-!(-*)S)
_filedir
return
;;
- -r|-V|--remove|--verify)
- COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
+ --remove|--verify|-!(-*)[rV])
+ COMPREPLY=( $(_comp_dpkg_installed_packages "$cur") )
return
;;
- -L|-P|--listfiles|--purge)
- COMPREPLY=( $( _comp_dpkg_purgeable_packages "$cur" ) )
+ --listfiles|--purge|-!(-*)[LP])
+ COMPREPLY=( $(_comp_dpkg_purgeable_packages "$cur") )
return
;;
esac
$split && return
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _dpkg dpkg dpkg-deb dpkg-query
@@ -95,15 +93,15 @@ _dpkg_reconfigure()
local opt
case $prev in
- -f|--frontend)
- opt=( $( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* ) )
+ --frontend|-!(-*)f)
+ opt=( $(printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/*) )
opt=( ${opt[@]##*/} )
opt=( ${opt[@]%.pm} )
- COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W '${opt[@]}' -- "$cur") )
return
;;
- -p|--priority)
- COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) )
+ --priority|-!(-*)p)
+ COMPREPLY=( $(compgen -W 'low medium high critical' -- "$cur") )
return
;;
esac
@@ -112,7 +110,7 @@ _dpkg_reconfigure()
COMPREPLY=( $(compgen -W '--frontend --priority --all --unseen-only
--help --showold --force --terse' -- "$cur" ) )
else
- COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
+ COMPREPLY=( $(_comp_dpkg_installed_packages "$cur") )
fi
} &&
complete -F _dpkg_reconfigure -o default dpkg-reconfigure