From: Clint Adams <schizo@debian.org>
To: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
Cc: zsh-workers@sunsite.auc.dk
Subject: PATCH: _arguments and _dpkg
Date: Fri, 16 Jun 2000 11:19:09 -0400 [thread overview]
Message-ID: <20000616111909.A7108@scowler.net> (raw)
In-Reply-To: <200006150806.KAA06014@beta.informatik.hu-berlin.de>; from wischnow@informatik.hu-berlin.de on Thu, Jun 15, 2000 at 10:06:47AM +0200
> - an option, say -I, which gives an array of options which are to be
> ignored but not completed
> - or, probably more more user-friendly, yet another optspec syntax
> describing options which are to be ignored but not completed; for
> example, if we find a syntax that starts with a special string for
> that, one could use <not>${^_dpkg_actions} in the second call to
> _arguments to make it skip all options described in $_dpkg_options
>
> I think I prefer the latter (or both). Anyone got an idea for an
> acceptable syntax? Or other suggestions?
I think I prefer the latter too. In the meantime, I'm using the following
patch.
Unfortunately, with current CVS, this results in anything beginning
with -- followed by the first letter of any of the long options
covered by the state engine to be not completed.
e.g. dpkg --p<TAB>, dpkg --pu<TAB>, dpkg --pur<TAB>, &c., will all
just insert a space.
Index: Completion/Debian/_dpkg
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Debian/_dpkg,v
retrieving revision 1.5
diff -u -r1.5 _dpkg
--- Completion/Debian/_dpkg 2000/06/13 17:45:56 1.5
+++ Completion/Debian/_dpkg 2000/06/16 15:09:48
@@ -1,7 +1,7 @@
#compdef dpkg dpkg-deb
local _dpkg_deb_actions _dpkg_common_actions _dpkg_actions _dpkg_options
-local _dpkg_options_recursive
+local _dpkg_options_recursive _dpkg_actions_install _dpkg_actions_record_avail
local curcontext="$curcontext" context state line expl ret
typeset -A opt_args
@@ -81,6 +81,8 @@
--{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')
+_dpkg_actions_install=('(--install)-i[install]' '(-i)--install')
+_dpkg_actions_record_avail=('(--record-avail)-A[record available]' '(-A)--record-avail')
case "${words[1]:t}" in
dpkg)
@@ -102,7 +104,8 @@
case "$state" in
install|record_avail)
_funcall ret _dpkg_$state && return ret
- _arguments -C -A "-*" -s "$_dpkg_options[@]" \
+ _arguments -C -s "$_dpkg_options[@]" \
+ "${(@e):-\$_dpkg_actions_${state}}" \
- recur \
'(--recursive)-R[recursive]' \
'(-R)--recursive' \
next prev parent reply other threads:[~2000-06-16 15:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-15 8:06 PATCH: _arguments (was: Re: odd diff completion) Sven Wischnowsky
2000-06-16 15:19 ` Clint Adams [this message]
2000-06-19 13:07 PATCH: _arguments and _dpkg Sven Wischnowsky
2000-06-19 14:40 ` 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=20000616111909.A7108@scowler.net \
--to=schizo@debian.org \
--cc=wischnow@informatik.hu-berlin.de \
--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).