Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: problem with _sysrc in zsh 5.3
- X-seq: zsh-workers 40597
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: problem with _sysrc in zsh 5.3
- Date: Mon, 20 Feb 2017 12:32:59 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1487590380; bh=LaMtglg/ZeW1G0v5IlXkJ2735S03yLR/Wr3+g0t3/vU=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=W2EEzPJ249LBCpdAfg0MI/WAisZWjntev/t4fdbg+1iSDoG7vKTj8evkzUViJ3Uf+m1NktlXIN+A7sJ/yFWatwDncW731+DzJf9DfJsE3atO5JRxMNxAHfkhSzpPWq0bSVTeoROO1/bGwPhSZgUzowQwCfVi5zdXKA26gWpoRXs4x8DeQXqOjti2BGk/qpxfkHU5j3vm6gnVNgwn51tfODL7EX7hT0gVn5+FZWo+rJXI5VDBi3uOwFjxT2LodXwP8l667NvScZwaKfnKT/hUXtekurmYq9Yo6xsxz5kNhi8A5XZXbCE6sz/ERNTzHmSaOgtAhwJW5K62KgqKKgQ9Pw==
- In-reply-to: <84fc5ed6-c65f-9164-6f02-ce18f769b0bb@gmx.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <84fc5ed6-c65f-9164-6f02-ce18f769b0bb@gmx.com>
Eric Cook wrote:
>
> # sysrc
> _describe:21: bad option: -C
> (eval):1: bad substitution
> (eval):1: not an identifier: [_-]=* r:|=*[@]
>
> This wasn't an problem with 5.2 from what i remember and when i move _value's
> -w option to appear after -C, the error doesn't appear.
>
> I also have a few personal completers that also calls _values -w -C ...
> but luckly nothing else in Completion/* does it.
>
> What change caused this?
38641. It didn't allow for _values options coming before -C or -O. Sorry
about that.
The use of -C in _sysrc seems fairly pointless given that it isn't used
with any states. It probably could attempt to complete some values.
Maybe just YES/NO for any configuration variable that ends in _enable.
Oliver
diff --git a/Completion/BSD/Command/_sysrc b/Completion/BSD/Command/_sysrc
index 651c18b89..246d73bd3 100644
--- a/Completion/BSD/Command/_sysrc
+++ b/Completion/BSD/Command/_sysrc
@@ -76,9 +76,9 @@ _sysrc() {
if (( $#rc_conf_vars )); then
if [[ $opt == N ]]; then
- _values -w -C variable ${^rc_conf_vars%%\[*}'::value' && ret=0
+ _values -w variable ${^rc_conf_vars%%\[*}'::value' && ret=0
else
- _values -w -C variable ${^rc_conf_vars}'::value' && ret=0
+ _values -w variable ${^rc_conf_vars}'::value' && ret=0
fi
fi
fi
diff --git a/Completion/Base/Utility/_values b/Completion/Base/Utility/_values
index c510b4cc0..6e38e00f4 100644
--- a/Completion/Base/Utility/_values
+++ b/Completion/Base/Utility/_values
@@ -1,13 +1,14 @@
#autoload
-local subopts opt usecc garbage
+local subopts opt usecc garbage keep
subopts=()
-zparseopts -D -a garbage C=usecc O:=subopts M: J: V: 1 2 n F: X:
+zparseopts -D -a garbage s+:=keep S+:=keep w+=keep C=usecc O:=subopts \
+ M: J: V: 1 2 n F: X:
(( $#subopts )) && subopts=( "${(@P)subopts[2]}" )
-if compvalues -i "$@"; then
+if compvalues -i "$keep[@]" "$@"; then
local noargs args opts descr action expl sep argsep subc test='*'
local oldcontext="$curcontext"
Messages sorted by:
Reverse Date,
Date,
Thread,
Author