summary refs log tree commit diff
path: root/Completion/Debian
diff options
context:
space:
mode:
authorSebastian Ramacher <sebastian@ramacher.at>2014-06-28 14:29:21 +0200
committerAxel Beckert <abe@deuxchevaux.org>2014-07-04 00:50:06 +0200
commit2abc8530dd259c3ac734e9464d2aa546c69b27ad (patch)
tree1a96324ceeb2f9c93f5967e68d2961b1c5d13797 /Completion/Debian
parentd6c759fc80b7162ce2b94877ebc8f18a52b81e10 (diff)
downloadzsh-2abc8530dd259c3ac734e9464d2aa546c69b27ad.tar.gz
zsh-2abc8530dd259c3ac734e9464d2aa546c69b27ad.tar.xz
zsh-2abc8530dd259c3ac734e9464d2aa546c69b27ad.zip
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
Diffstat (limited to 'Completion/Debian')
-rw-r--r--Completion/Debian/Command/_dpkg12
1 files changed, 12 insertions, 0 deletions
diff --git a/Completion/Debian/Command/_dpkg b/Completion/Debian/Command/_dpkg
index e7184e7cc..3503d09b9 100644
--- a/Completion/Debian/Command/_dpkg
+++ b/Completion/Debian/Command/_dpkg
@@ -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