zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH] _subversion: Complete multiple comma-separated arguments to --show-item=<TAB>.
Date: Fri,  8 Nov 2019 14:22:39 +0000	[thread overview]
Message-ID: <20191108142239.18910-1-danielsh@tarpaulin.shahaf.local2> (raw)

---
 Completion/Unix/Command/_subversion | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

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:} )

                 reply	other threads:[~2019-11-08 14:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191108142239.18910-1-danielsh@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).