about summary refs log tree commit diff
path: root/Completion/Debian
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-04-12 03:03:44 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-04-12 03:03:44 +0000
commita7589435512f24fce13ba09ffe204eee4b356e6e (patch)
tree668f2ab587c049bcf28dafa230351f9482a91f70 /Completion/Debian
parent204f6c24489a6000483a6c95c7d6291efa0cc67f (diff)
downloadzsh-a7589435512f24fce13ba09ffe204eee4b356e6e.tar.gz
zsh-a7589435512f24fce13ba09ffe204eee4b356e6e.tar.xz
zsh-a7589435512f24fce13ba09ffe204eee4b356e6e.zip
Merge from trunk of workers/{21231,21233}.
Diffstat (limited to 'Completion/Debian')
-rw-r--r--Completion/Debian/Command/_dpkg54
1 files changed, 44 insertions, 10 deletions
diff --git a/Completion/Debian/Command/_dpkg b/Completion/Debian/Command/_dpkg
index 962adf825..770130e53 100644
--- a/Completion/Debian/Command/_dpkg
+++ b/Completion/Debian/Command/_dpkg
@@ -1,10 +1,21 @@
-#compdef dpkg dpkg-deb dpkg-reconfigure
+#compdef dpkg dpkg-deb dpkg-query dpkg-reconfigure
 
 local _dpkg_deb_actions _dpkg_common_actions _dpkg_actions _dpkg_options
-local _dpkg_options_recursive _dpkg_actions_install _dpkg_actions_record_avail
+local _dpkg_options_recursive #_dpkg_actions_install _dpkg_actions_record_avail
+local _dpkg_deb_only_actions
+local _dpkg_deb_and_query_only_actions _dpkg_deb_and_query_only_options 
+local _dpkg_query_actions
 local curcontext="$curcontext" context state line expl ret
 typeset -A opt_args
 
+_dpkg_deb_only_actions=(
+    '-D[debugging output]'
+    '(--new)--old[old archive format]'
+    '(--old)--new[new archive format]'
+    '--nocheck[suppress control file check]'
+    '-z+[compression level]:compression number:(1 2 3 4 5 6 7 8 9)'
+)
+
 _dpkg_deb_actions=(
   '(--build -b)'{--build,-b}'[build archive]:directory:_files -/'
   '(--contents -c)'{--contents,-c}'[list contents]:Debian package:_files -g "*.u#deb(-.)"'
@@ -28,20 +39,15 @@ _dpkg_actions=(
   '--configure[reconfigure specified packages]:*:package:->configure'
   '(--remove -r)'{--remove,-r}'[remove package]:*:package:->remove'
   '(--purge -P)'{--purge,-P}'[purge package]:*:package:->purge'
-  '(--print-avail -p)'{--print-avail,-p}'[display available details]:packages:_deb_packages avail'
   '--update-avail[update available]:package file:_files'
   '--merge-avail[merge available]:package file:_files'
   '(--record-avail -A)'{--record-avail,-A}'[record available]:*:package files:->record_avail'
   '--forget-old-unavail[forget uninstalled unavailable]'
   '--clear-avail[clear available]'
-  '(--list -l)'{--list,-l}'[list packages]:*:packages:->list'
-  '(--status -s)'{--status,-s}'[display package status]:*:packages:->status'
   '(--audit -C)'{--audit,-C}'[check for broken pkgs]'
   '--get-selections[get selections]:pattern:'
   '--set-selections[set selections]'
   '--yet-to-unpack[list uninstalled]'
-  '(--listfiles, -L)'{--listfiles,-L}'[list owned files]:*:packages:->listfiles'
-  '(--search -S)'{--search,-S}'[search for file owner]:*:pattern:->search'
   '--print-architecture[print target architecture]'
   '--print-gnu-build-architecture'
   '--print-installation-architecture'
@@ -50,7 +56,6 @@ _dpkg_actions=(
 
 _dpkg_options=(
   '--abort-after[abort after errors]:number of errors:'
-  '--admindir=[data directory]:directory:_files -/'
   '--root=[alternative root]:root:_files -/'
   '--instdir=[change inst root but not data dir]:_files -/'
   '(--selected-only -O)'{--selected-only,-O}'[skip unselected packages]'
@@ -68,6 +73,23 @@ _dpkg_options=(
 
 _dpkg_options_recursive=( '(--recursive -R)'{--recursive,-R}'[recursive]' )
 
+_dpkg_deb_and_query_only_actions=(
+    '(--show -W)'{--show,-W}'[show package info]:Debian package:_files -g \*.u\#deb'
+)
+
+_dpkg_deb_and_query_only_options=(
+    '--showformat=-[alternative format]:format: '
+)
+
+_dpkg_query_actions=(
+      '(--status -s)'{--status,-s}'[display package status]:*:packages:->status'
+      '(--print-avail -p)'{--print-avail,-p}'[display available details]:packages:_deb_packages avail'
+      '(--listfiles, -L)'{--listfiles,-L}'[list owned files]:*:packages:->listfiles'
+      '(--list -l)'{--list,-l}'[list packages]:*:packages:->list'
+      '(--search -S)'{--search,-S}'[search for file owner]:*:pattern:->search'
+      '--admindir=[data directory]:directory:_files -/'
+)
+
 # not needed anymore?
 #  _dpkg_actions_install=('(--install)-i[install]' '(-i)--install')
 #  _dpkg_actions_record_avail=('(--record-avail)-A[record available]' '(-A)--record-avail')
@@ -79,12 +101,24 @@ case "$service" in
       "$_dpkg_deb_actions[@]" \
       "$_dpkg_common_actions[@]" \
       "$_dpkg_options[@]" \
-      "$_dpkg_options_recursive[@]" && return 0
+      "$_dpkg_options_recursive[@]" \
+      "$_dpkg_query_actions[@]" && return 0
   ;;
 
   dpkg-deb)
     _arguments "$_dpkg_deb_actions[@]" \
-	"$_dpkg_common_actions[@]" && return 0
+        "$_dpkg_deb_only_actions[@]" \
+        "$_dpkg_common_actions[@]" \
+        "$_dpkg_deb_and_query_only_actions[@]" \
+        "$_dpkg_deb_and_query_only_options[@]" && return 0
+
+  ;;
+
+  dpkg-query)
+    _arguments "$_dpkg_query_actions[@]" \
+           "$_dpkg_common_actions[@]" \
+           "$_dpkg_deb_and_query_only_actions[@]" \
+           "$_dpkg_deb_and_query_only_options[@]" && return 0
   ;;
   dpkg-reconfigure)
     _arguments -sw \