zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] _git: Add completion for help subcommand
@ 2010-08-21 12:21 Aaron Schrab
  2010-08-25 22:16 ` Nikolai Weibull
  0 siblings, 1 reply; 17+ messages in thread
From: Aaron Schrab @ 2010-08-21 12:21 UTC (permalink / raw)
  To: zsh-workers

---
 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..50b503a 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 () {
+  local formats='(--info -i --man -m --web -w)'
+  _arguments -S \
+    - '(all)' \
+    {--all,-a}'[List all available commands]' \
+    - 'format' \
+    "$formats"{--man,-m}'[Display help in man page format]' \
+    "$formats"{--info,-i}'[Display help in info format]' \
+    "$formats"{--web,-w}'[Display help in web browser]' \
+    ':command:_git_commands' && ret=0
+}
+
 (( $+functions[_git-index-pack] )) ||
 _git-index-pack () {
   local -a stdin_arguments
-- 
1.7.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-12-04 18:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-21 12:21 [PATCH] _git: Add completion for help subcommand Aaron Schrab
2010-08-25 22:16 ` Nikolai Weibull
2010-08-26  3:29   ` Benjamin R. Haskell
2010-08-26  7:55     ` Nikolai Weibull
2010-08-30 16:43       ` Bart Schaefer
2010-08-30 18:59         ` Nikolai Weibull
2010-08-31  6:57           ` Bart Schaefer
2010-08-27  0:20   ` Aaron Schrab
2010-08-27  8:29     ` Nikolai Weibull
2010-08-27 23:18       ` Aaron Schrab
2010-08-27 23:43         ` Nikolai Weibull
2010-08-28  0:51           ` Aaron Schrab
2010-08-28  7:54             ` Nikolai Weibull
2010-08-28 14:16               ` Aaron Schrab
2010-08-28 14:24                 ` Nikolai Weibull
2010-12-02  0:44             ` Aaron Schrab
2010-12-04 18:10               ` Wayne Davison

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).