From: Clint Adams <schizo@debian.org>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: stylistic override to _deb_packages
Date: Sat, 29 Jan 2000 17:37:22 -0500 [thread overview]
Message-ID: <20000129173722.A13963@scowler.net> (raw)
With this patch, 'packageset' can be used to override the
argument to _deb_packages.
Index: Completion/Debian/_deb_packages
===================================================================
RCS file: /cvs/zsh/zsh/Completion/Debian/_deb_packages,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 _deb_packages
--- Completion/Debian/_deb_packages 1999/12/27 21:22:24 1.1.1.5
+++ Completion/Debian/_deb_packages 2000/01/29 22:31:49
@@ -32,16 +32,24 @@
}
_deb_packages () {
- local command="$argv[$#]" expl cachevar
+ local command="$argv[$#]" expl cachevar pkgset
[[ "$command" = (installed|uninstalled|avail) ]] || {
_message "_deb_packages:unknown command: $command"
return
}
+ zstyle -s ":completion${curcontext}" packageset pkgset
+
+ [[ "$pkgset" = (installed|uninstalled|avail|available) ]] || {
+ pkgset="$command"
+ }
+
+ [[ "$pkgset" = "available" ]] && pkgset="avail"
+
expl=("${(@)argv[1,-2]}")
- _deb_packages_updage_$command
+ _deb_packages_updage_$pkgset
_tags packages && compadd "$expl[@]" - "${(e):-"\${(@)$cachevar}"}"
}
Index: Completion/Debian/_dpkg
===================================================================
RCS file: /cvs/zsh/zsh/Completion/Debian/_dpkg,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 _dpkg
--- Completion/Debian/_dpkg 1999/12/29 07:44:21 1.1.1.4
+++ Completion/Debian/_dpkg 2000/01/29 22:31:49
@@ -1,7 +1,5 @@
#compdef dpkg dpkg-deb
-local dds
-
_dpkg_deb_args=('(--build)-b[build archive]:directory:_files -/' \
'(-b)--build:directory:_files -/' \
'(--contents)-c[list contents]:Debian package:_files -g \*.deb' \
@@ -22,9 +20,6 @@
'--version[show version]' \
'--licence[show licensing]')
-zstyle -s ':completion${curcontext}:deb:dpkg' status dds
-[[ "$dds" == installed ]] || dds="avail"
-
case "$words[1]" in
dpkg)
_arguments -s '(--install)-i[install packages]:Debian package:_files -g \*.deb' \
@@ -43,8 +38,8 @@
'--merge-avail[merge available]:package file:_files' \
'--clear-avail[clear available]' \
'--forget-old-unavail[forget uninstalled unavailable]' \
- '(--status)-s[display package status]:packages:_deb_packages $dds' \
- '(-s)--status:packages:_deb_packages $dds' \
+ '(--status)-s[display package status]:packages:_deb_packages installed' \
+ '(-s)--status:packages:_deb_packages installed' \
'(--print-avail)-p[display available details]:packages:_deb_packages avail' \
'(-p)--print-avail:packages:_deb_packages avail' \
'(--listfiles)-L[list owned files]:packages:_deb_packages installed' \
Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /cvs/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.1.1.116
diff -u -r1.1.1.116 compsys.yo
--- Doc/Zsh/compsys.yo 2000/01/21 16:33:54 1.1.1.116
+++ Doc/Zsh/compsys.yo 2000/01/29 22:31:50
@@ -546,7 +546,7 @@
used to look up the tt(users-hosts) style
)
item(tt(packages))(
-for packages (e.g. tt(rpm) packages)
+for packages (e.g. tt(rpm) or installed tt(Debian) packages)
)
item(tt(parameters))(
for names of parameters
@@ -1108,6 +1108,15 @@
it will first try to generate matches without inserting the `tt(*)'
and if that yields no matches, it will try again with the `tt(*)'
inserted.
+)
+item(tt(packageset))(
+A style containing an override for the default package set
+for that context. For example,
+
+example(zstyle :completion:complete::dpkg::--status-1 packageset avail)
+
+will cause available packages, rather than only installed packages,
+to be completed for `dpkg --status'.
)
item(tt(path))(
This is used together with the the tt(urls) tag by completion
next reply other threads:[~2000-01-29 22:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-01-29 22:37 Clint Adams [this message]
2000-01-30 1:20 ` Tanaka Akira
2000-02-01 11:08 ` Alexandre Duret-Lutz
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=20000129173722.A13963@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).