zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: _arguments (was: Re: PATCH: Updated _rpm, but a bug with _arguments and: make check failure with latest CVS)
Date: Tue, 30 May 2000 09:46:40 +0200 (MET DST)	[thread overview]
Message-ID: <200005300746.JAA19777@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Tue, 30 May 2000 05:54:16 +0000


Bart Schaefer wrote:

> On May 30,  3:19am, Bart Schaefer wrote:
> } Subject: PATCH: Updated _rpm, but a bug with _arguments
> }
> } As of the current CVS sources (_arguments revision 1.25) completion for rpm
> } doesn't work any longer:
> } 
> } zagzig[24] rpm --rc<TAB>
> } Completing no arguments
> } (beep)
> 
> It's actually much worse than this; option completion is entirely broken
> when there's anything in the current word other than the leading hyphens.
> The culprits seem to be the following two hunks of 11624; for example, if
> I delete the `&& !line[2]' then completion after two hyphens and an alpha-
> numeric starts working again, but one hyphen and an alphanum still fails.

Yep, they should only be used when we have multiple sets. Sorry.

The patch also moves the rpm-query-comments because they made _rpm
fail for me.


Vin Shelton wrote:

> I'm getting the following error from 'make check':
> 
>     /usr/local/src/zsh-2000-05-29/Test/52zregexparse.ztst: all tests successful.
>     *** /tmp/zsh.ztst.out.12028     Mon May 29 14:55:41 2000
>     --- /tmp/zsh.ztst.tout.12028    Mon May 29 14:55:41 2000
>     ***************
>     *** 1,2 ****
>     ! line: {tst -}{}
>     ! MESSAGE:{arg}
>     --- 1 ----
>     ! line: {tst -x }{}
>     Test /usr/local/src/zsh-2000-05-29/Test/53completion.ztst failed: output differs from expected as shown above for:
>      comptesteval 'compdef _tst tst; _tst () { _arguments "-x" ":arg:" }'
>      comptest $'tst -\t'
>     Was testing: _arguments
>     /usr/local/src/zsh-2000-05-29/Test/53completion.ztst: test failed.

This had to do with _arguments, too. And with _message. Or something.
Since _message doesn't add a dummy match anymore, the message isn't
shown. For now I've just changed the test, but I've put it onto my
list and will fix it after 3.1.7, together with the other things I
mentioned in 11565.


Bye
 Sven

Index: Completion/Base/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/_arguments,v
retrieving revision 1.25
diff -u -r1.25 _arguments
--- Completion/Base/_arguments	2000/05/29 09:15:14	1.25
+++ Completion/Base/_arguments	2000/05/30 07:44:50
@@ -319,6 +319,7 @@
 	        compadd -QqS= - "${PREFIX}${SUFFIX}"
           else
 	    tmp1=( "$next[@]" "$direct[@]" "$odirect[@]" "$equal[@]" )
+	    [[ "$PREFIX" != --* ]] && tmp1=( "${(@)tmp1:#--*}" )
 	    tmp3=( "${(M@)tmp1:#[-+]?[^:]*}" )
 	    tmp1=( "${(M@)tmp1:#[-+]?(|:*)}" )
 	    tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" )
Index: Completion/Linux/_rpm
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Linux/_rpm,v
retrieving revision 1.10
diff -u -r1.10 _rpm
--- Completion/Linux/_rpm	2000/05/30 03:54:36	1.10
+++ Completion/Linux/_rpm	2000/05/30 07:44:50
@@ -117,6 +117,8 @@
 
   case "$lstate" in
   query)
+    # --dump requires on of -{l,c,d}
+    # --triggers requires --script
     _arguments -s \
       -q "${commonopts[@]}" "${packageopts[@]}" "${pathopts[@]}" \
       '--queryformat:RPM query format:->tags' \
@@ -126,11 +128,11 @@
       '-s[show file states]' \
       '-d[documentation files only]' \
       '-c[configuration files only]' \
-      '--dump[show all information]'     # Requires one of -{l,c,d} ... \
+      '--dump[show all information]' \
       --provides \
       -{R,-requires}'[list dependencies]' \
       '--scripts[show (un)install scripts]' \
-      '--triggers[show trigger scripts]' # Requires --scripts ... \
+      '--triggers[show trigger scripts]' \
       '*:RPM package:->package_or_file' && ret=0
     ;;
   setattrs)
@@ -195,14 +197,14 @@
     ;;
   target)
     _wanted target expl 'Target platforms' \
-        compadd $(_call target rpm --showrc |grep 'compatible archs'|sed 's/.*: //') && ret=0
+        compadd $(_call target rpm --showrc 2> /dev/null |grep 'compatible archs'|sed 's/.*: //') && ret=0
     ;;
   package_or_file)
     state=package_file
     ;&
   package)
     _wanted packages expl 'RPM package' \
-        compadd -M 'r:|-=* r:|=*' - $(_call packages rpm -qa) && ret=0
+        compadd -M 'r:|-=* r:|=*' - $(_call packages rpm -qa 2> /dev/null) && ret=0
     ;;
   spec_file)
     _wanted specfiles expl 'spec file' \
@@ -224,7 +226,7 @@
     if compset -P '*%*\{'; then
       _wanted tags expl 'RPM tag' \
           compadd -M 'm:{a-z}={A-Z}' -S '\}' - \
-                  "${(@)${(@f)$(_call tags rpm --querytags)}#RPMTAG_}" && ret=0
+                  "${(@)${(@f)$(_call tags rpm --querytags 2> /dev/null)}#RPMTAG_}" && ret=0
     else
       _message 'RPM format'
     fi
Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.24
diff -u -r1.24 computil.c
--- Src/Zle/computil.c	2000/05/29 08:00:47	1.24
+++ Src/Zle/computil.c	2000/05/30 07:44:51
@@ -1437,7 +1437,7 @@
 		 state.def->type == CAA_RARGS)) {
 		state.inrest = 0;
 		state.opt = (cur == state.nargbeg + 1 &&
-			     (!*line || 
+			     (!multi || !*line || 
 			      ((*line == '-' || *line == '+') &&
 			       (!line[1] ||
 				(*line == '-' && line[1] == '-' && !line[2])))));
@@ -1516,7 +1516,7 @@
 		}
 	    } else {
 		ca_laststate.def = adef;
-		ca_laststate.opt = (!arglast || !*line || 
+		ca_laststate.opt = (!arglast || !multi || !*line || 
 				    ((*line == '-' || *line == '+') &&
 				     (!line[1] ||
 				      (*line == '-' && line[1] == '-' && !line[2]))));
Index: Test/53completion.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/53completion.ztst,v
retrieving revision 1.4
diff -u -r1.4 53completion.ztst
--- Test/53completion.ztst	2000/05/17 12:31:32	1.4
+++ Test/53completion.ztst	2000/05/30 07:44:51
@@ -129,8 +129,7 @@
  comptesteval 'compdef _tst tst; _tst () { _arguments "-x" ":arg:" }'
  comptest $'tst -\t'
 0:_arguments
->line: {tst -}{}
->MESSAGE:{arg}
+>line: {tst -x }{}
 
  comptesteval 'compdef _tst tst; _tst () { _arguments "-x:arg:" }'
  comptest $'tst -x\t'

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-05-30  7:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-30  7:46 Sven Wischnowsky [this message]
2000-05-30  7:51 ` Bart Schaefer

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=200005300746.JAA19777@beta.informatik.hu-berlin.de \
    --to=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).