From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12914 invoked by alias); 28 Aug 2010 00:59:51 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28210 Received: (qmail 7842 invoked from network); 28 Aug 2010 00:59:50 -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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at schrab.com designates 208.78.100.134 as permitted sender) Resent-From: aaron@schrab.com Resent-Date: Fri, 27 Aug 2010 20:59:45 -0400 Resent-Message-ID: <20100828005945.GC29397@pug.qqx.org> Resent-To: zsh-workers@zsh.org Date: Fri, 27 Aug 2010 20:51:50 -0400 From: Aaron Schrab To: zsh-workers@zsh.org Subject: Re: _git: Add completion for help subcommand Message-ID: <20100828005150.GB29397@pug.qqx.org> References: <1282393263-16767-1-git-send-email-aaron@schrab.com> <20100827002003.GA8399@pug.qqx.org> <20100827231832.GA29397@pug.qqx.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) At 01:43 +0200 28 Aug 2010, Nikolai Weibull wrote: >A final nit-pick: Why put --all in a separate group? Because it supersedes any other option. I suppose it could be put into the common options, with other options excluded and the other options excluding it. But if that's going to be the preferred way of handling this type of situation, what's the point of having support for mutually exclusive sets of options? But, I did notice that there was an error in the previous version of the patch. It didn't actually prevent completion of command names with --all. I'd been testing a copy of the file other than the one I was modifying. Revised, and hopefully final, version below. From e87683251e5c5c5737a118031582ee4500bac4ee Mon Sep 17 00:00:00 2001 From: Aaron Schrab Date: Thu, 19 Aug 2010 19:11:06 -0400 Subject: [PATCH] _git: Add completion for help subcommand --- Completion/Unix/Command/_git | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index c394e08..570d08f 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -190,6 +190,7 @@ _git_commands () { 'fetch:download objects and a head from another repository' 'gc:cleanup unnecessary files and optimize the local repository' 'grep:print lines matching a pattern' + 'help:display help information about git subcommands' 'init:create empty git object database' 'log:show commit logs' 'merge:grand unified merge driver' @@ -490,6 +491,19 @@ _git-hash-object () { '(--stdin):file:_files' && ret=0 } +(( $+functions[_git-help] )) || +_git-help () { + _arguments -S \ + ':command:_git_commands' \ + - '(all)' \ + '(:)'{--all,-a}'[List all available commands]' \ + - '(format)' \ + {--man,-m}'[Display help in man page format]' \ + {--info,-i}'[Display help in info format]' \ + {--web,-w}'[Display help in web browser]' \ + && ret=0 +} + (( $+functions[_git-index-pack] )) || _git-index-pack () { local -a stdin_arguments -- 1.7.0.4