From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20179 invoked by alias); 27 Aug 2010 00:30:13 -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: 28206 Received: (qmail 17572 invoked from network); 27 Aug 2010 00:30:10 -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) Date: Thu, 26 Aug 2010 20:20:04 -0400 From: Aaron Schrab To: zsh-workers@zsh.org Cc: Nikolai Weibull Subject: Re: _git: Add completion for help subcommand Message-ID: <20100827002003.GA8399@pug.qqx.org> Mail-Followup-To: zsh-workers@zsh.org, Nikolai Weibull References: <1282393263-16767-1-git-send-email-aaron@schrab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) At 00:16 +0200 26 Aug 2010, Nikolai Weibull wrote: >On Sat, Aug 21, 2010 at 14:21, Aaron Schrab wrote: > >Seems fine except for this: > >> + =C2=A0local formats=3D'(--info -i --man -m --web -w)' > >Although this is sort of nice it doesn=E2=80=99t follow the style of this = or >other completion files, so please write out the whole list in each >line. I think that results in unnecessary duplication, but I guess the list=20 isn't big enough or likely to change often enough for that to be a major=20 issue. So here's a version with the requested modification. --- Completion/Unix/Command/_git | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index c394e08..bccd43a 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,18 @@ _git-hash-object () { '(--stdin):file:_files' && ret=3D0 } =20 +(( $+functions[_git-help] )) || +_git-help () { + _arguments -S \ + - '(all)' \ + {--all,-a}'[List all available commands]' \ + - 'format' \ + "(--info -i --man -m --web -w)"{--man,-m}'[Display help in man page fo= rmat]' \ + "(--info -i --man -m --web -w)"{--info,-i}'[Display help in info forma= t]' \ + "(--info -i --man -m --web -w)"{--web,-w}'[Display help in web browser= ]' \ + ':command:_git_commands' && ret=3D0 +} + (( $+functions[_git-index-pack] )) || _git-index-pack () { local -a stdin_arguments --=20 1.7.1