about summary refs log tree commit diff
path: root/Completion/Debian/Command/_aptitude
diff options
context:
space:
mode:
authorFrank Terbeck <bewater@users.sourceforge.net>2011-07-01 12:04:54 +0000
committerFrank Terbeck <bewater@users.sourceforge.net>2011-07-01 12:04:54 +0000
commit47347fc7d7decb08155abbeebdbeed4fc7ace6d9 (patch)
treed732fe36548a7d969edfe7b54a85fda69d4e3cb5 /Completion/Debian/Command/_aptitude
parent73497c5f5eb2e003d758b96e8e55ee52090727ae (diff)
downloadzsh-47347fc7d7decb08155abbeebdbeed4fc7ace6d9.tar.gz
zsh-47347fc7d7decb08155abbeebdbeed4fc7ace6d9.tar.xz
zsh-47347fc7d7decb08155abbeebdbeed4fc7ace6d9.zip
Daniel Bolton: 29529: _aptitude: Complete format specifiers with the `-F' option.
Diffstat (limited to 'Completion/Debian/Command/_aptitude')
-rw-r--r--Completion/Debian/Command/_aptitude35
1 files changed, 34 insertions, 1 deletions
diff --git a/Completion/Debian/Command/_aptitude b/Completion/Debian/Command/_aptitude
index bfec49730..2c462e462 100644
--- a/Completion/Debian/Command/_aptitude
+++ b/Completion/Debian/Command/_aptitude
@@ -13,6 +13,39 @@ ${${(M)${(f)"$(</etc/apt/sources.list)"}\
   #}}}
 }
 
+# Helper function for -F / --display-format
+function _aptitude_format_strings() {
+  _values -s , 'format string' \
+    '%%[Literal %]' \
+    '%#number[Parameter replacement]' \
+    '%a[Action flag]' \
+    '%A[Action]' \
+    '%B[Broken count]' \
+    '%c[Current state flag]' \
+    '%C[Current state]' \
+    '%d[Description]' \
+    '%H[Hostname]' \
+    '%i[Pin priority]' \
+    '%I[Installed size]' \
+    '%m[Maintainer]' \
+    '%M[Automatic flag]' \
+    '%n[Program version]' \
+    '%N[Program name]' \
+    '%o[Download size]' \
+    '%p[Package name]' \
+    '%P[Priority]' \
+    '%r[Reverse depends count]' \
+    '%R[Abbreviated priority]' \
+    '%s[Section]' \
+    '%S[Trust status]' \
+    '%t[Archive]' \
+    '%T[Tagged]' \
+    '%u[Disk usage change]' \
+    '%v[Current version]' \
+    '%V[Candidate version]' \
+    '%Z[Size change]'
+}
+
 _arguments -C \
   '(- 1 *)'{-h,--help}'[display help information]' \
   '(- 1 *)--version[display version information]' \
@@ -20,7 +53,7 @@ _arguments -C \
   '(-d --download-only)'{-d,--download-only}"[just download packages - don\'t install]" \
   '(-P --prompt)'{-P,--prompt}'[always display a prompt]' \
   '(-y --assume-yes)'{-y,--assume-yes}'[assume yes answer to questions]' \
-  '(-F --display-format)'{-F,--display-format}'[specify output format for search command]:format' \
+  '(-F --display-format)'{-F,--display-format}'[specify output format for search command]:format:_aptitude_format_strings' \
   '(-O --sort)'{-O,--sort}'[specify sort order]:sort order:()' \
   '(-w --width)'{-w,--width}'[specify output width]:width' \
   '-f[aggressivley try to fix dependencies of broken packages]' \