Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Completion: Fix _wajig



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
   ;;



Messages sorted by: Reverse Date, Date, Thread, Author