From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19147 invoked by alias); 28 Sep 2010 18:01:56 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15437 Received: (qmail 29984 invoked from network); 28 Sep 2010 18:01:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 74.125.82.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=PshuEE63r0nRhgOC4q8BP9lYTkkonh+rF3NcbNYnK5Y=; b=q402f0T6RBWdlwcntIE4TeGSyZ0x/4SknMvG2rI6hTXCChusPNwYyKQq0CtGQCxkL1 CDzPLnVB1LBu1yGSpyOmMqp5C5w2o5tfjmX6p+252JtcwBCfjRrUBoir/rw1iRPkyiNX JHM3CY2ZLelquSFj66YPJ1Nt+xOGbnrC2baYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mq/Fj0ldSAN/7XxgiZ/A8Vy5Mz5ra+kfbY/s5ChtKnYXLOgrp16zd+vGfGqxR7wi9m vYou2lW/L556ZJy4Q2LTiS4AjtzaYoB0WEWTwlBFr+N5esLKdUNNjifDK7MLLrfoAoQd orfk+PJZrTYbYtDnCK5va+gVYIJDf3jwMw0q4= MIME-Version: 1.0 In-Reply-To: <20100928080340.GJ9720@fsst.voodoo.lan> References: <20100928080340.GJ9720@fsst.voodoo.lan> Date: Tue, 28 Sep 2010 19:01:49 +0100 Message-ID: Subject: Re: _git Completion and custom commands From: Conrad Irwin To: zsh-users@zsh.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 28 September 2010 09:03, Frank Terbeck wrote: > Benjamin R. Haskell : > [...] >>> The one issue I've found is that the _git completion function (as of >>> 4.3.10 shipped with Debian testing) does not include custom commands >>> (though it does include aliases). > [...] >> zstyle ':completion:*:git:*' user-commands ${${(k)commands[(I)git-*]}#gi= t-} > This is perfect =97 thank you! > Yes, this is explained at the top of the _git completion file. > On some version later than the version I used to have. Thank you for your help (on IRC) in getting the right version of the _git function, which allowed Ben's command to work. > Now, if you want smartness, when you try `git foo ' you may > write a function `_git-foo()' and _git will pick it up. So, if > your `git-foo' program supports a few options (-f, -v and -q), a > completion function may look like this: > > The `style' line Benjamin gave sets the `user-commands' style to a > list of all `git-*' commands zsh finds in $PATH. It's useful if you > got a *lot* of own scripts. Since zsh cannot guess a description for > the programs this way, commands added like that will be missing > descriptions. I do have a large number of commands, but luckily I know what they do :). So I'm going with the automagic rather than the explicit =97 though I may consider the additional options for the few commands that take several options (particularly those that mix the arguments of other git commands) > PS: If the OP didn't configure compsys yet, then > =A0 =A0 may serve him > =A0 =A0as a quickstart. I'll certainly help to get menus such as the > =A0 =A0ones I mentioned above. > I was just comparing this to the default that Debian gave me =97 I'll have to investigate further. Thanks to everyone. Conrad