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>
This commit is contained in:
parent
8024ea60db
commit
6672950945
@ -626,6 +626,10 @@ __git_aliased_command ()
|
|||||||
config --get "alias.$1")
|
config --get "alias.$1")
|
||||||
for word in $cmdline; do
|
for word in $cmdline; do
|
||||||
case "$word" in
|
case "$word" in
|
||||||
|
\!gitk|gitk)
|
||||||
|
echo "gitk"
|
||||||
|
return
|
||||||
|
;;
|
||||||
\!*) : shell command alias ;;
|
\!*) : shell command alias ;;
|
||||||
-*) : option ;;
|
-*) : option ;;
|
||||||
*=*) : setting env ;;
|
*=*) : setting env ;;
|
||||||
@ -1087,6 +1091,11 @@ _git_gc ()
|
|||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_git_gitk ()
|
||||||
|
{
|
||||||
|
_gitk
|
||||||
|
}
|
||||||
|
|
||||||
_git_grep ()
|
_git_grep ()
|
||||||
{
|
{
|
||||||
__git_has_doubledash && return
|
__git_has_doubledash && return
|
||||||
|
Loading…
Reference in New Issue
Block a user