From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23166 invoked from network); 7 Sep 1999 22:26:53 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Sep 1999 22:26:53 -0000 Received: (qmail 4958 invoked by alias); 7 Sep 1999 22:26:49 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7705 Received: (qmail 4951 invoked from network); 7 Sep 1999 22:26:45 -0000 From: "Bart Schaefer" Message-Id: <990907222631.ZM11028@candle.brasslantern.com> Date: Tue, 7 Sep 1999 22:26:31 +0000 In-Reply-To: Comments: In reply to Tanaka Akira "Re: PATCH: Completion/User/_cvs again." (Sep 7, 7:47pm) References: <199909070717.JAA03524@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail Lite (5.0.0 30July97) To: Tanaka Akira Subject: Re: PATCH: Completion/User/_cvs again. Cc: zsh-workers@sunsite.auc.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 }