From ddee5deb2dda383d597af69971cb8d85e3dc1598 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 4 Dec 2010 18:08:12 +0000 Subject: Add completion for help subcommand to _git. --- Completion/Unix/Command/_git | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Completion') diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index af716be85..8e54f3d90 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' @@ -492,6 +493,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 -- cgit 1.4.1