1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00

32814: Add some more recent dpkg options

Expands dpkg completion by adding the --add-architecture,
--remove-architecture, and --print-foreign-architectures options.

Initially submitted to Debian at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681518#13
This commit is contained in:
Sebastian Ramacher 2014-06-28 14:29:21 +02:00 committed by Axel Beckert
parent d6c759fc80
commit 2abc8530dd
2 changed files with 16 additions and 0 deletions

View file

@ -9,6 +9,10 @@
* Daniel Bolton: 32815: Completion/Debian/Command/_aptitude:
missing resolver options
* Sebastian Ramacher: 32814: Completion/Debian/Command/_dpkg:
Add --add-architecture, --remove-architecture, and
--print-foreign-architectures options.
2014-07-03 Mikael Magnusson <mikachu@gmail.com>
* 32821: Completion/Unix/Command/_gcc: Update _gcc as of GCC

View file

@ -50,6 +50,9 @@ _dpkg_actions=(
'--yet-to-unpack[list uninstalled]'
'--print-architecture[print target architecture]'
'--print-installation-architecture'
'--print-foreign-architectures[print list of extra architectures]'
'--add-architecture[add extra architecture]:architecture:->add_architecture'
'--remove-architecture[remove extra architecture]:architecture:->remove_architecture'
'--compare-versions[compare version numbers]:*::expression:= ->compare_versions'
)
@ -179,4 +182,13 @@ case "$state" in
_call_function ret _dpkg_$state && return ret
_files
;;
add_architecture)
_call_function ret _dpkg_$state && return ret
_wanted architecture expl 'extra architecture' \
compadd ${(f)"$(dpkg-architecture -L 2>/dev/null)"}
;;
remove_architecture)
_call_function ret _dpkg_$state && return ret
_wanted architecture expl 'extra architecture' \
compadd ${(f)"$(dpkg --print-foreign-architectures 2>/dev/null)"}
esac