Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: parameter substitution used in _values
- X-seq: zsh-workers 14658
- From: Oliver Kiddle <opk@xxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: parameter substitution used in _values
- Date: Fri, 01 Jun 2001 15:21:02 +0100
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200106011339.PAA14041@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Sender: kiddleo
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author