zsh-workers
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Zsh workers <zsh-workers@zsh.org>
Subject: [PATCH] Completion: Fix _wajig
Date: Fri, 22 Jun 2018 10:59:07 -0500	[thread overview]
Message-ID: <B129F618-D6BA-4271-9FE1-AC5DB25B8C89@dana.is> (raw)

Someone on /r/zsh complained that wajig sub-commands don't complete. There must
have been an output format change some time ago.

This updates the function to account for the format change, and also improves
the description capitalisation and escaping.

dana


diff --git a/Completion/Debian/Command/_wajig b/Completion/Debian/Command/_wajig
index 26d08cfd7..630507e67 100644
--- a/Completion/Debian/Command/_wajig
+++ b/Completion/Debian/Command/_wajig
@@ -14,7 +14,8 @@ _arguments -C -s \
 
 case $state in
   cmds)
-    cmds=( ${${(M)${(f)"$(wajig commands 2>/dev/null)"}:# [^-]*}/(#b) ([^ ]#) #(*)/$match[1]:$match[2]:l} )
+    cmds=( ${(f)"$( _call_program commands $words[1] commands )"} )
+    cmds=( ${(@)cmds/(#b)([^ ]##) ##(?)(*)/$match[1]:${match[2]:l}${match[3]//:/\\:}} )
 
     _describe -t commands 'wajig command' cmds && ret=0
   ;;


                 reply	other threads:[~2018-06-22 15:59 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=B129F618-D6BA-4271-9FE1-AC5DB25B8C89@dana.is \
    --to=dana@dana.is \
    --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).