summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2019-11-07 17:48:11 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2019-11-09 12:39:48 +0000
commitb06117ad21ce8be928e64700f34f7610d45c738a (patch)
tree7b92f7c91a7c673677cd1daa5826150833cd7230
parent369e4a4057fa283ae27c69601deacc79ad95ca8e (diff)
downloadzsh-b06117ad21ce8be928e64700f34f7610d45c738a.tar.gz
zsh-b06117ad21ce8be928e64700f34f7610d45c738a.tar.xz
zsh-b06117ad21ce8be928e64700f34f7610d45c738a.zip
44904: _subversion: Complete multiple comma-separated arguments to --show-item=<TAB>.
Upstream revision: r1869578 (for 1.14.0)
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_subversion9
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f8998cc20..64b230cb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-09  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* 44904: Completion/Unix/Command/_subversion: Complete multiple
+	comma-separated arguments to --show-item=<TAB>.
+
 2019-11-08  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* unposted: Doc/Zsh/compsys.yo: _values: Use the formal
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 28223c55b..b5532b101 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -3,8 +3,9 @@
 _svn () {
   local curcontext="$curcontext" state line expl ret=1
   typeset -A opt_args
+  local i
 
-  # Colons in values must be escaped.
+  # Colons and closing square brackets in values must be escaped.
   local -A show_item_keys=(
      kind                  "the kind of TARGET (file or dir)"
      url                   "the URL of TARGET in the repository"
@@ -112,7 +113,11 @@ _svn () {
           done
           while (( idx=$args[(I)*--show-item:arg:] )); do
             # (q) to quote the parentheses in the value
-            args[idx]=( --show-item'=:item key:(('"`for i j in ${(kv)show_item_keys}; do print -rn - $i\\\\:"${(q)j}" ""; done`"'))' )
+            local -a show_items_plain_array
+            for i in ${(k)show_item_keys}; do
+              show_items_plain_array+=( $i\[${show_item_keys[$i]}\] )
+            done
+            args[idx]=( --show-item'=:item key:_values -s , "info items" ${show_items_plain_array[@]}' )
           done
           # All other options get {-x+,--long-x=}
           args=( ${args/(#b)(--[A-Za-z0-9-]##):arg:/$match[1]=:arg:} )