Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Re: tags stuff
- X-seq: zsh-workers 8644
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: PATCH: Re: tags stuff
- Date: Mon, 15 Nov 1999 14:40:47 +0100 (MET)
- In-reply-to: Sven Wischnowsky's message of Mon, 15 Nov 1999 13:07:28 +0100 (MET)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
I wrote:
> Argh. Sorry I change the getopts used in `_arguments' and `_values' bu
> didn't remove the `shift OPTIND-1's.
No, Sven, that's not good at all. If you use `getopts ":O:C" opt' this
will loop over all arguments given to `_arguments'. Makes things
slow. Ah, see, you've already been wondering why `xdvi <TAB>' became
so slow.
So we better use a simple custom-made loop.
Bye
Sven
diff -u -r oldcompletion/Base/_arguments Completion/Base/_arguments
--- oldcompletion/Base/_arguments Mon Nov 15 13:07:55 1999
+++ Completion/Base/_arguments Mon Nov 15 14:35:45 1999
@@ -153,12 +153,12 @@
fi
subopts=()
-while getopts ':O:C' opt; do
- if [[ "$opt" = O ]]; then
- subopts=( "${(@P)OPTARG}" )
- else
- usecc=yes
- fi
+while [[ "$1" = -(O*|C) ]]; do
+ case "$1" in
+ -C) usecc=yes; shift ;;
+ -O) subopts=( "${(@P)2}" ); shift 2 ;;
+ *) subopts=( "${(@P)1[3,-1]}" ); shift ;;
+ esac
done
_style -s options auto-description autod
diff -u -r oldcompletion/Base/_values Completion/Base/_values
--- oldcompletion/Base/_values Mon Nov 15 13:07:55 1999
+++ Completion/Base/_values Mon Nov 15 14:36:04 1999
@@ -3,12 +3,12 @@
local subopts opt usecc
subopts=()
-while getopts ':O:C' opt; do
- if [[ "$opt" = O ]]; then
- subopts=( "${(@P)OPTARG}" )
- else
- usecc=yes
- fi
+while [[ "$1" = -(O*|C) ]]; do
+ case "$1" in
+ -C) usecc=yes; shift ;;
+ -O) subopts=( "${(@P)2}" ); shift 2 ;;
+ *) subopts=( "${(@P)1[3,-1]}" ); shift ;;
+ esac
done
if compvalues -i "$@"; then
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author