zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: PATCH: _baz, _tla
Date: Sun, 17 Apr 2005 09:37:27 -0400	[thread overview]
Message-ID: <20050417133727.GA27005@scowler.net> (raw)

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


                 reply	other threads:[~2005-04-17 13:37 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=20050417133727.GA27005@scowler.net \
    --to=clint@zsh.org \
    --cc=zsh-workers@sunsite.dk \
    /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).