From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6992 invoked from network); 16 Jun 2000 15:19:30 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Jun 2000 15:19:30 -0000 Received: (qmail 14451 invoked by alias); 16 Jun 2000 15:19:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11951 Received: (qmail 14442 invoked from network); 16 Jun 2000 15:19:19 -0000 Date: Fri, 16 Jun 2000 11:19:09 -0400 From: Clint Adams To: Sven Wischnowsky Cc: zsh-workers@sunsite.auc.dk Subject: PATCH: _arguments and _dpkg Message-ID: <20000616111909.A7108@scowler.net> References: <200006150806.KAA06014@beta.informatik.hu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i 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 ${^_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, dpkg --pu, dpkg --pur, &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' \