This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zbysz
Recipients andybuckley, bethard, eric.araujo, gruszczy, marcs, ndim, r.david.murray, wplappert, zbysz
Date 2012-02-22.16:27:35
SpamBayes Score 5.869438e-11
Marked as misclassified No
Message-id <1329928056.94.0.780567607506.issue4256@psf.upfronthosting.co.za>
In-reply-to
Content
zsh completion is much more powerful. E.g. for git<SP>log<SP><TAB> I see:
completing head
<list-of-heads>
completing commit object name
completing cached file
abspath.c                   git-lost-found.sh           README                    
aclocal.m4                  git-merge-octopus.sh        reflog-walk.c             
...

git<SP><TAB>
completing alias
diffab                    -- alias for 'diff --src-prefix=a/ --dst-prefix=b/'
lol                       -- alias for 'log --graph --decorate --pretty=oneline --abbrev-commit'
lola                      -- alias for 'log --graph --decorate --pretty=oneline --abbrev-commit --all'
mergeu                    -- alias for 'merge --ff-only @{u}'
completing main porcelain command
add                       -- add file contents to index
am                        -- apply patches from a mailbox
...

The header parts ('completing commit object name', 'completing head',
'completing cached file') are in bold red. So different completions
types are supported, and some help is provided, and completions
are split in groups.

Completion for options knows which short/long options go together:
git log -<TAB> prints:
...
--oneline                                          -- shorthand for --pretty=oneline --abbrev-commit    
--ours                    -2                       -- diff against "our branch" version                 
--parents                                          -- display parents of commit                         
--patch                   -u           -p          -- generate diff in patch format                     
...

fish ("a friendly interactive shell" which I don't use but
which has some very cool features) prints something like
a\%b                                                                                         (Branch)
abspath.c                                                                      (C source code, 4.2kB)
abspath.o                                                                         (Object code, 13kB)
aclocal.m4                                                                          (M4 macro, 1.4kB)
adres                                                                                     (File, 23B)
advice.c                                                                       (C source code, 2.4kB)
advice.h                                                                             (C header, 555B)

I think that for --help-options to be usefull, it should list more information
than is needed just for bash completion. At least:
- options, with long and short options specified together
- short help for options (or maybe all of the help)
- option groups if such are used
- metavar names

This last part could be used by the completion script to customize completions
for a specific program. E.g. the completion script could know that FILE means a file,
and HOST means a host name.
History
Date User Action Args
2012-02-22 16:27:37zbyszsetrecipients: + zbysz, bethard, ndim, eric.araujo, wplappert, andybuckley, r.david.murray, gruszczy, marcs
2012-02-22 16:27:36zbyszsetmessageid: <1329928056.94.0.780567607506.issue4256@psf.upfronthosting.co.za>
2012-02-22 16:27:36zbyszlinkissue4256 messages
2012-02-22 16:27:35zbyszcreate