zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _baz, _tla
@ 2005-04-17 13:37 Clint Adams
  0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2005-04-17 13:37 UTC (permalink / raw)
  To: zsh-workers

The "shift 6 input" leads to trouble with help output inconsistencies,
so it's better to strip out -h, -H, and -V in the for loop.

Index: Completion/Unix/Command/_baz
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_baz,v
retrieving revision 1.5
diff -u -r1.5 _baz
--- Completion/Unix/Command/_baz	16 Apr 2005 20:22:47 -0000	1.5
+++ Completion/Unix/Command/_baz	17 Apr 2005 13:33:24 -0000
@@ -490,8 +490,7 @@
 
     arguments=()
     local input
-    input=(${${(f)"$($BAZ $cmd -h)"}#  })
-    shift 6 input
+    input=(${${(M)${(f)"$($BAZ $cmd -h)"}:#  *}#  })
 
     local i j=1
     local short long arg desc action
@@ -513,6 +512,7 @@
         (( i++ ))
         desc[j]="$desc[j] ${input[i]##*  }"
       fi
+      [[ "$short[j]" == -[hHV] ]] && continue
       desc[j]="${${desc[j]//\[/\\[}//\]/\\]}" # escape brackets
 
       case $arg[j] in
Index: Completion/Unix/Command/_tla
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_tla,v
retrieving revision 1.5
diff -u -r1.5 _tla
--- Completion/Unix/Command/_tla	16 Apr 2005 20:22:47 -0000	1.5
+++ Completion/Unix/Command/_tla	17 Apr 2005 13:33:25 -0000
@@ -527,8 +527,7 @@
 
     arguments=()
     local input
-    input=(${${(f)"$($TLA $cmd -h)"}#  })
-    shift 6 input
+    input=(${${(M)${(f)"$($TLA $cmd -h)"}:#  *}#  })
 
     local i j=1
     local short long arg desc action
@@ -550,6 +549,7 @@
         (( i++ ))
         desc[j]="$desc[j] ${input[i]##*  }"
       fi
+      [[ "$short[j]" == -[hHV] ]] && continue
       desc[j]="${${desc[j]//\[/\\[}//\]/\\]}" # escape brackets
 
       case $arg[j] in


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-04-17 13:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-17 13:37 PATCH: _baz, _tla Clint Adams

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).