diff options
author | SZEDER Gábor <szeder@ira.uka.de> | 2010-02-24 00:03:00 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-24 19:32:31 +0300 |
commit | 66729509457f11b15216c3cdfdbb2f34eddfbe89 (patch) | |
tree | 69cf07599d1f75320145cfd3b891faa3c3a20885 /contrib | |
parent | 8024ea60db290dd64db294e1019a0ada64ce1770 (diff) |
bash: completion for gitk aliases
gitk aliases either start with "!gitk", or look something like "!sh -c
FOO=bar gitk", IOW they contain the "gitk" word. With this patch the
completion script will recognize these cases and will offer gitk's
options.
Just like the earlier change improving on aliased command recognition,
this change can also be fooled easily by some complex aliases, but
users of such aliases could remedy it with custom completion
functions.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/completion/git-completion.bash | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 8593fd707b..3029f160b0 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -626,6 +626,10 @@ __git_aliased_command () config --get "alias.$1") for word in $cmdline; do case "$word" in + \!gitk|gitk) + echo "gitk" + return + ;; \!*) : shell command alias ;; -*) : option ;; *=*) : setting env ;; @@ -1087,6 +1091,11 @@ _git_gc () COMPREPLY=() } +_git_gitk () +{ + _gitk +} + _git_grep () { __git_has_doubledash && return |