Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _git Completion and custom commands
- X-seq: zsh-users 15437
- From: Conrad Irwin <conrad.irwin@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: _git Completion and custom commands
- Date: Tue, 28 Sep 2010 19:01:49 +0100
- 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=
- In-reply-to: <20100928080340.GJ9720@xxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AANLkTimE+8OYZXmpmdepsY-WkLjSkE+VB3hdQpBQ0p_c@xxxxxxxxxxxxxx> <alpine.LNX.2.01.1009272342180.30023@hp> <20100928080340.GJ9720@xxxxxxxxxxxxxxx>
On 28 September 2010 09:03, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> Benjamin R. Haskell <zsh@xxxxxxxxxx>:
> [...]
>>> 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-*]}#git-}
>
This is perfect — 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 <tab>' 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 — 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
> <http://zshwiki.org/home/examples/compquickstart> may serve him
> as a quickstart. I'll certainly help to get menus such as the
> ones I mentioned above.
>
I was just comparing this to the default that Debian gave me — I'll
have to investigate further.
Thanks to everyone.
Conrad
Messages sorted by:
Reverse Date,
Date,
Thread,
Author