From: Clint Adams <schizo@debian.org>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: _dpkg improvements
Date: Tue, 13 Jun 2000 13:34:57 -0400 [thread overview]
Message-ID: <20000613133457.A22818@scowler.net> (raw)
This adds -A "-*" to something very similar to what I posted before.
Index: Completion/Debian/_dpkg
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Debian/_dpkg,v
retrieving revision 1.4
diff -u -r1.4 _dpkg
--- Completion/Debian/_dpkg 2000/06/04 18:32:19 1.4
+++ Completion/Debian/_dpkg 2000/06/13 17:29:28
@@ -1,7 +1,8 @@
#compdef dpkg dpkg-deb
local _dpkg_deb_actions _dpkg_common_actions _dpkg_actions _dpkg_options
-local curcontext="$curcontext" state line expl ret
+local _dpkg_options_recursive
+local curcontext="$curcontext" context state line expl ret
typeset -A opt_args
_dpkg_deb_actions=('(--build)-b[build archive]:directory:_files -/' \
@@ -28,7 +29,7 @@
_dpkg_actions=('(--install)-i[install packages]:*:Debian packages:->install' \
'(-i)--install:*:Debian packages:->install' \
'--unpack[unpack package]:Debian package:_files -g \*.deb' \
- '--configure:package:_deb_packages installed' \
+ '--configure:*:package:->configure' \
'(--remove)-r[remove package]:*:package:->remove' \
'(-r)--remove:*:package:->remove' \
'(--purge)-P[purge package]:*:package:->purge' \
@@ -37,8 +38,8 @@
'(-p)--print-avail:packages:_deb_packages avail' \
'--update-avail[update available]:package file:_files' \
'--merge-avail[merge available]:package file:_files' \
- '(--record-avail)-A[record available]:package file:_files' \
- '(-A)--record-avail:package file:_files' \
+ '(--record-avail)-A[record available]:*:package files:->record_avail' \
+ '(-A)--record-avail:*:package files:->record_avail' \
'--forget-old-unavail[forget uninstalled unavailable]' \
'--clear-avail[clear available]' \
'(--list)-l[list packages]:*:packages:->list' \
@@ -57,7 +58,7 @@
'--print-architecture[print target architecture]' \
'--print-gnu-build-architecture[print GNU version of target architecture]' \
'--print-installation-architecture[print host architecture]' \
- '--compare-versions[compare version numbers]:expression:')
+ '--compare-versions[compare version numbers]:*:expression:->compare_versions')
_dpkg_options=('--abort-after[abort after errors]:number of errors:' \
'--admindir=[data directory]:directory:_files -/' \
@@ -79,12 +80,15 @@
'--ignore-depends=[ignore depends involving package]:package:_deb_packages avail' \
--{force,refuse,no-force}'--[forcing options]:what:(auto-select downgrade configure-any hold bad-path not-root overwrite overwrite-diverted depends-version depends confnew confold confdef confmiss conflicts architecture overwrite-dir remove-reinstreq remove-essential)')
+_dpkg_options_recursive=('(--recursive)-R[recursive]' '(-R)--recursive')
+
case "${words[1]:t}" in
dpkg)
_arguments -C -s "$_dpkg_actions[@]" \
"$_dpkg_deb_actions[@]" \
"$_dpkg_common_actions[@]" \
- "$_dpkg_options[@]"
+ "$_dpkg_options[@]" \
+ "$_dpkg_options_recursive[@]"
;;
dpkg-deb)
@@ -96,19 +100,39 @@
esac
case "$state" in
- install)
+ install|record_avail)
_funcall ret _dpkg_$state && return ret
- _arguments -C -s "$_dpkg_options[@]" \
- '*:Debian package:_files -g \*.deb'
-;;
+ _arguments -C -A "-*" -s "$_dpkg_options[@]" \
+ - recur \
+ '(--recursive)-R[recursive]' \
+ '(-R)--recursive' \
+ ':directory:_files -/' \
+ - nonrecur \
+ ':Debian package:_files -g \*.deb'
+ ;;
remove|purge|status|listfiles)
_funcall ret _dpkg_$state && return ret
- _arguments -C -s "$_dpkg_options[@]" \
+ _arguments -C -A "-*" -s "$_dpkg_options[@]" \
'*:package:_deb_packages installed'
-;;
+ ;;
list)
_funcall ret _dpkg_$state && return ret
- _arguments -C -s "$_dpkg_options[@]" \
- '*:packages:_deb_packages avail' \
-;;
+ _arguments -C -A "-*" -s "$_dpkg_options[@]" \
+ '*:packages:_deb_packages avail'
+ ;;
+ compare_versions)
+ _funcall ret _dpkg_$state && return ret
+ _arguments -C -A "-*" -s "$_dpkg_options[@]" \
+ '2:version A:' \
+ '3:operator:(lt le eq ne ge gt lt-nl le-nl ge-nl gt-nl)' \
+ '4:version B:'
+ ;;
+ configure)
+ _funcall ret _dpkg_$state && return ret
+ _arguments -C -A "-*" -s '--configure' \
+ "$_dpkg_options[@]" \
+ '(--pending)-a[pending packages]' \
+ '(-a)--pending' \
+ '*:package:_deb_packages installed'
+ ;;
esac
next reply other threads:[~2000-06-13 18:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-13 17:34 Clint Adams [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-06-04 18:27 Clint Adams
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=20000613133457.A22818@scowler.net \
--to=schizo@debian.org \
--cc=zsh-workers@sunsite.auc.dk \
/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).