git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Matthieu Moy <Matthieu.Moy@imag.fr>,
	Ramkumar Ramachandra <artagnon@gmail.com>
Subject: Re: [PATCH 2/2] complete: zsh: use zsh completion for the main cmd
Date: Sat, 27 Apr 2013 16:53:49 -0500	[thread overview]
Message-ID: <CAMP44s1dEydqNWH+dFTCj13dfOCVym9XHCYnx12E5hosYNF9Rg@mail.gmail.com> (raw)
In-Reply-To: <7vtxmrsleq.fsf@alter.siamese.dyndns.org>

On Sat, Apr 27, 2013 at 4:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> +__git_zsh_cmd_common ()
>> +{
>> +     local -a list
>> +     list=(
>> +     add:'add file contents to the index'
>> +     bisect:'find by binary search the change that introduced a bug'
>> +     branch:'list, create, or delete branches'
>> +     checkout:'checkout a branch or paths to the working tree'
>> +     clone:'clone a repository into a new directory'
>> +     commit:'record changes to the repository'
>> +     diff:'show changes between commits, commit and working tree, etc'
>> +     fetch:'download objects and refs from another repository'
>> +     grep:'print lines matching a pattern'
>> +     init:'create an empty Git repository or reinitialize an existing one'
>> +     log:'show commit logs'
>> +     merge:'join two or more development histories together'
>> +     mv:'move or rename a file, a directory, or a symlink'
>> +     pull:'fetch from and merge with another repository or a local branch'
>> +     push:'update remote refs along with associated objects'
>> +     rebase:'forward-port local commits to the updated upstream head'
>> +     reset:'reset current HEAD to the specified state'
>> +     rm:'remove files from the working tree and from the index'
>> +     show:'show various types of objects'
>> +     status:'show the working tree status'
>> +     tag:'create, list, delete or verify a tag object signed with GPG')
>
> Maintaining this list feels somewhat painful.  Isn't this something
> we can help by tweaking "git help"?

Yes, that's the way Bazaar does it (bzr shell-complete), but for now
this does the trick.

Also, I've been carrying around the patches from Stephen Boyd that add
--dump-raw-long-options. I think it would be better if somehow 'git
help' learned how to throw this output for both commands and
arguments, and then use the first part for bash, or specify bash
format somehow. Of course, we would need to add support for
descriptions in the option parser.

It's the big world-domination plan for completions, but I haven't had
time to work on that.

Cheers.

-- 
Felipe Contreras

      reply	other threads:[~2013-04-27 21:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-27 20:34 [PATCH 0/2] completion: zsh: nice stuff Felipe Contreras
2013-04-27 20:34 ` [PATCH 1/2] complete: zsh: trivial simplification Felipe Contreras
2013-04-27 20:34 ` [PATCH 2/2] complete: zsh: use zsh completion for the main cmd Felipe Contreras
2013-04-27 21:39   ` Junio C Hamano
2013-04-27 21:53     ` Felipe Contreras [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMP44s1dEydqNWH+dFTCj13dfOCVym9XHCYnx12E5hosYNF9Rg@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=Matthieu.Moy@imag.fr \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).