From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12697 invoked by alias); 6 Apr 2014 16:07:06 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32533 Received: (qmail 29014 invoked from network); 6 Apr 2014 16:06:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_FAIL autolearn=ham version=3.3.2 From: Alessandro Ghedini 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 Message-Id: <1396800279-27189-2-git-send-email-alessandro@ghedini.me> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1396800279-27189-1-git-send-email-alessandro@ghedini.me> References: <1396800279-27189-1-git-send-email-alessandro@ghedini.me> From: Sebastian Ramacher 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