From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28526 invoked from network); 30 Dec 2007 19:25:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Dec 2007 19:25:29 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 57249 invoked from network); 30 Dec 2007 19:25:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Dec 2007 19:25:22 -0000 Received: (qmail 20537 invoked by alias); 30 Dec 2007 19:25:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24327 Received: (qmail 20524 invoked from network); 30 Dec 2007 19:25:17 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 30 Dec 2007 19:25:17 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id 703108058F9B for ; Sun, 30 Dec 2007 20:25:15 +0100 (CET) Received: from uucp.gnuu.de (banki.eumelnet.de [83.246.114.63]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Sun, 30 Dec 2007 20:25:15 +0100 (CET) Received: by uucp.gnuu.de (Postfix, from userid 10) id F32C0488073; Sun, 30 Dec 2007 20:25:09 +0100 (CET) Received: from news by alea.gnuu.de with local (Exim 4.63) (envelope-from ) id 1J93hN-0005IY-K2 for zsh-workers@sunsite.dk; Sun, 30 Dec 2007 20:19:49 +0100 To: zsh-workers@sunsite.dk Path: not-for-mail From: =?UTF-8?Q?J=C3=B6rg?= Sommer Newsgroups: local.mailinglist.zsh Subject: run-help: Support for svn and git Date: Sun, 30 Dec 2007 19:19:49 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: alea.gnuu.de 1199042389 20362 192.168.0.5 (30 Dec 2007 19:19:49 GMT) X-Complaints-To: usenet@alea.gnuu.de User-Agent: slrn/pre0.9.9-75 (Debian) Sender: news X-Virus-Scanned: ClamAV using ClamSMTP Hi, calling run-help for svn or git is often not very helpful. svn has no real information in the manpage and the infos for git blubb are in git-blubb (not git). So, run-help should pay attention to the subcommand for git and should call svn help subcommand |pager. My proposal: #v+ --- /usr/share/zsh-beta/functions/Misc/run-help 2007-12-26 00:58:01.000000000 +0100 +++ /tmp/run-help 2007-12-30 20:18:37.530179261 +0100 @@ -12,8 +12,37 @@ : ${HELPDIR:=/usr/share/zsh-beta/help} -[[ $1 == "." ]] && 1="dot" -[[ $1 == ":" ]] && 1="colon" +local subcmd +subcmd= + +case $1 in + (.) 1=dot;; + (:) 1=colon;; + (git|sv[kn]) + local full_cmd + builtin getln full_cmd + builtin print -z "$full_cmd" + local i + for i in ${(z)full_cmd#*$1}; do # remove VARIABLE=... $1 + case "$i" in + (-*) ;; + (*) + case $1 in + (git) + if al=$(git config --get "alias.$i"); then + 1="git-${al%% *}" + else + 1="git-$i" + fi + ;; + (sv[kn]) subcmd=$i;; + esac + break + ;; + esac + done + ;; +esac if [[ $# == 0 || $1 == "-l" ]] then @@ -85,7 +114,11 @@ man zsh-betamisc ;; (*) + if [[ -n "${subcmd:-}" ]]; then + ((! didman++)) && $1 help $subcmd | ${=PAGER:-/usr/bin/pager} + else ((! didman++)) && man $@ + fi ;; esac if ((i < $#places && ! didman)) #v- Would you include this change? Bye, Jörg. -- Es liegt in der Natur des Menschen, vernünftig zu denken und unlogisch zu handeln! Das Gesagte ist nicht das Gemeinte und das Gehörte nicht das Verstandene!