zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: zsh workers <zsh-workers@zsh.org>
Cc: Daniel Bolton <dan@dbbo.us>, 632140@bugs.debian.org
Subject: PATCH: _aptitude: Completion for -F format specifiers
Date: Fri,  1 Jul 2011 11:04:14 +0200	[thread overview]
Message-ID: <1309511054-7003-1-git-send-email-ft@bewatermyfriend.org> (raw)
In-Reply-To: <20110629200601.5518.79542.reportbug@ganymed.my.domain>

From: Daniel Bolton <dan@dbbo.us>

Received via the Debian BTS: #632140

Thanks!
---
 Completion/Debian/Command/_aptitude |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/Completion/Debian/Command/_aptitude b/Completion/Debian/Command/_aptitude
index bfec497..2c462e4 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]' \
-- 
1.7.6


           reply	other threads:[~2011-07-01 11:49 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20110629200601.5518.79542.reportbug@ganymed.my.domain>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1309511054-7003-1-git-send-email-ft@bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=632140@bugs.debian.org \
    --cc=dan@dbbo.us \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).