zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Tanaka Akira <akr@jaist.ac.jp>
Cc: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Completion/User/_cvs again.
Date: Tue, 7 Sep 1999 22:26:31 +0000	[thread overview]
Message-ID: <990907222631.ZM11028@candle.brasslantern.com> (raw)
In-Reply-To: <rsqg10r2e2a.fsf@crane.jaist.ac.jp>

On Sep 7,  7:47pm, Tanaka Akira wrote:
> 
> I changed `_cvs' a bit. This change just its style

As long as we're talking style, why do with a `case` what you can do with
substitution?  I think the following is a lot more easily maintained, if
maybe a bit less readable ...

Index: Completion/User/_cvs
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.1/Completion/User/_cvs,v
retrieving revision 1.15
diff -u -r1.15 _cvs
--- _cvs	1999/09/07 21:43:55	1.15
+++ _cvs	1999/09/07 22:23:19
@@ -35,34 +35,8 @@
   if (( CURRENT == 1 )); then
     compadd "$@" ${(k)cmds} || compadd "$@" ${(kv)=cmds}
   else
-    case "${${(k)cmds[(R)* $words[1] *]}:-$words[1]}" in
-      add) _cvs_add;;
-      admin) _cvs_admin;;
-      annotate) _cvs_annotate;;
-      checkout) _cvs_checkout;;
-      commit) _cvs_commit;;
-      diff) _cvs_diff;;
-      edit) _cvs_edit;;
-      editors) _cvs_editors;;
-      export) _cvs_export;;
-      history) _cvs_history;;
-      import) _cvs_import;;
-      init) _cvs_init;;
-      log) _cvs_log;;
-      login) _cvs_login;;
-      logout) _cvs_logout;;
-      rdiff) _cvs_rdiff;;
-      release) _cvs_release;;
-      remove) _cvs_remove;;
-      status) _cvs_status;;
-      rtag) _cvs_rtag;;
-      tag) _cvs_tag;;
-      unedit) _cvs_unedit;;
-      update) _cvs_update;;
-      watch) _cvs_watch;;
-      watchers) _cvs_watchers;;
-      *) _message "unknown cvs command: $words[1]";;
-    esac
+    _cvs_"${${(k)cmds[(R)* $words[1] *]}:-$words[1]}" 2>&- ||
+      _message "unknown cvs command: $words[1]"
   fi
 }
 


  reply	other threads:[~1999-09-07 22:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-07  7:17 Sven Wischnowsky
1999-09-07 10:47 ` Tanaka Akira
1999-09-07 22:26   ` Bart Schaefer [this message]
1999-09-07 22:58     ` Tanaka Akira
1999-09-08  0:46       ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
1999-09-08  8:27 Sven Wischnowsky
1999-09-08  7:08 Sven Wischnowsky
1999-09-07 11:51 Sven Wischnowsky
1999-09-07 11:22 Sven Wischnowsky
1999-09-06 18:10 Tanaka Akira
1999-09-07 21:06 ` Bart Schaefer
1999-09-07 23:22   ` Tanaka Akira

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=990907222631.ZM11028@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=akr@jaist.ac.jp \
    --cc=zsh-workers@sunsite.auc.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).