about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2017-03-04 00:33:20 +0100
committerOliver Kiddle <opk@zsh.org>2017-03-04 00:33:20 +0100
commit7fd62f43674a8cb8504b91aed4cd2f815350d5f0 (patch)
treefb75dea20d0e896ec1dea7ec13a4d12d09fac826
parentc8005af3102adfd80f778a86096dbd712e3f60bc (diff)
downloadzsh-7fd62f43674a8cb8504b91aed4cd2f815350d5f0.tar.gz
zsh-7fd62f43674a8cb8504b91aed4cd2f815350d5f0.tar.xz
zsh-7fd62f43674a8cb8504b91aed4cd2f815350d5f0.zip
40597: be flexible about order of options to _values
-rw-r--r--ChangeLog8
-rw-r--r--Completion/BSD/Command/_sysrc4
-rw-r--r--Completion/Base/Utility/_values7
3 files changed, 13 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index fcd01ab4f..f97341077 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
+2017-03-04  Oliver Kiddle  <opk@zsh.org>
+
+	* 40597: Completion/BSD/Command/_sysrc,
+	Completion/Base/Utility/_values: be flexible about order of
+	options to _values
+
 2017-03-03  Peter Stephenson  <p.stephenson@samsung.com>
 
-	* Sebastain: 40170: Src/Modules/curses.c: Fix up error number
+	* Sebastian: 40170: Src/Modules/curses.c: Fix up error number
 	resetting in curses module.  This appears to resolve an issue
 	mentioned in comments but attributed elsewhere, so remove
 	confusion here.
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"