zsh-workers
 help / color / mirror / code / Atom feed
From: Alessandro Ghedini <alessandro@ghedini.me>
To: zsh-workers@zsh.org
Subject: [PATCH 2/2] _apt: add completion for 'apt-mark' command
Date: Sun,  6 Apr 2014 18:04:39 +0200	[thread overview]
Message-ID: <1396800279-27189-2-git-send-email-alessandro@ghedini.me> (raw)
In-Reply-To: <1396800279-27189-1-git-send-email-alessandro@ghedini.me>

From: Sebastian Ramacher <sebastian@ramacher.at>

Bug: https://bugs.debian.org/691526
---
 Completion/Debian/Command/_apt | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt
index 6f0bded..bf5343a 100644
--- a/Completion/Debian/Command/_apt
+++ b/Completion/Debian/Command/_apt
@@ -1,4 +1,4 @@
-#compdef apt apt-get apt-cache apt-cdrom apt-config
+#compdef apt apt-get apt-cache apt-cdrom apt-config apt-mark
 
 _apt () {
   case "$service" in
@@ -7,6 +7,7 @@ _apt () {
     apt-cache) _apt-cache "$@";;
     apt-cdrom) _apt-cdrom "$@";;
     apt-config) _apt-config "$@";;
+    apt-mark) _apt-mark "$@";;
     *) _message "unknown command $service";;
   esac
 }
@@ -619,4 +620,34 @@ _apt_caching_policy () {
      /var/lib/dpkg/available -nt "$1" ]]
 }
 
+_apt-mark () {
+  _apt_arguments _apt-mark_sm \
+    -h,--help:bool \
+    -v,--version:bool \
+    -f,--file:configfile \
+    -c,--config-file:configfile \
+    -o,--option:arbitem \
+    -qq:bool \
+    -s:bool \
+    -- \
+    /$'auto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
+    /$'manual\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
+    /$'hold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
+    /$'unhold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
+    /$'showauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
+    /$'showmanual\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
+    /$'showhold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
+    /"[]"/	':argument-1::compadd "$expl_action[@]" auto manual hold unhold showauto showmanual showhold'
+
+  _apt-mark () {
+    local expl_action expl_packages
+    _description actions expl_action 'action'
+    _description packages expl_packages 'package'
+
+    _apt-mark_sm
+  }
+
+  _apt-mark "$@"
+}
+
 _apt "$@"
-- 
1.9.1


      reply	other threads:[~2014-04-06 16:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-06 16:04 [PATCH 1/2] _apt: add completion for 'apt' command Alessandro Ghedini
2014-04-06 16:04 ` Alessandro Ghedini [this message]

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=1396800279-27189-2-git-send-email-alessandro@ghedini.me \
    --to=alessandro@ghedini.me \
    --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).