zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: parameter substitution used in _values
Date: Fri, 01 Jun 2001 15:21:02 +0100	[thread overview]
Message-ID: <3B17A4CE.F65E4BE5@u.genie.co.uk> (raw)
In-Reply-To: <200106011339.PAA14041@beta.informatik.hu-berlin.de>

Sven Wischnowsky wrote:
> 
> The problem is that the positional parameters are internally turned into
> `$argv[n]'.  And, as one can see,

Ah, that explains.

> In the shell code we have to use `${(@P)${1[1,3]}}' for now.  Oliver, if
> you have your hands in there anyway, could you?

Okay. I assume you meant ${(@P)${1[3,-1]}} and this change does that and
the same for a similar piece of code in _arguments. I was looking at
using zparseopts to handle more options but I won't change it to that
this close to the release.

Does `opt' need to be declared local in _values for any reason or is
that some old leftover?

Oliver

Index: Base/Utility/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v
retrieving revision 1.6
diff -u -r1.6 _arguments
--- Base/Utility/_arguments     2001/05/31 12:38:34     1.6
+++ Base/Utility/_arguments     2001/06/01 14:13:20
@@ -178,7 +178,7 @@
   case "$1" in
   -C)  usecc=yes; shift ;;
   -O)  subopts=( "${(@P)2}" ); shift 2 ;;
-  -O*) subopts=( "${(@P)1[3,-1]}" ); shift ;;
+  -O*) subopts=( "${(@P)${1[3,-1]}}" ); shift ;;
   -R)  rawret=yes; shift;;
   -w)  optarg=yes; shift;;
   -s)  singopt=(-s); shift;;
Index: Base/Utility/_values
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_values,v
retrieving revision 1.3
diff -u -r1.3 _values
--- Base/Utility/_values        2001/05/31 08:18:37     1.3
+++ Base/Utility/_values        2001/06/01 14:13:20
@@ -7,7 +7,7 @@
   case "$1" in
   -C) usecc=yes; shift ;;
   -O) subopts=( "${(@P)2}" ); shift 2 ;;
-  *)  subopts=( "${(@P)1[3,-1]}" ); shift ;;
+  *)  subopts=( "${(@P)${1[3,-1]}}" ); shift ;;
   esac
 done


  reply	other threads:[~2001-06-01 14:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-01 13:14 Oliver Kiddle
2001-06-01 13:39 ` Sven Wischnowsky
2001-06-01 14:21   ` Oliver Kiddle [this message]
2001-06-01 15:01   ` 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=3B17A4CE.F65E4BE5@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=zsh-workers@sunsite.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).