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

PATCH: _baz, _tla



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



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