summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2009-04-06 01:31:27 -0700
committerJunio C Hamano <gitster@pobox.com>2009-04-07 22:19:56 -0700
commite2dc2de917778a0601564e238c3cd61614f55e5f (patch)
treecfc1ce95aba50eba711f65323b20a9c80ae60534 /contrib/completion
parenta904392eaeee1629c0ac14dae8e579bb8497636a (diff)
downloadgit-e2dc2de917778a0601564e238c3cd61614f55e5f.tar.gz
bash completion: add git-difftool
This adds completion for difftool's --tool flag. The known diff tool names were also consolidated into a single variable. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rwxr-xr-xcontrib/completion/git-completion.bash27
1 files changed, 22 insertions, 5 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index e099ed48ff..069e19e82a 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -910,6 +910,26 @@ _git_diff ()
__git_complete_file
}
+__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
+ tkdiff vimdiff gvimdiff xxdiff
+"
+
+_git_difftool ()
+{
+ local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "$cur" in
+ --tool=*)
+ __gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}"
+ return
+ ;;
+ --*)
+ __gitcomp "--tool="
+ return
+ ;;
+ esac
+ COMPREPLY=()
+}
+
__git_fetch_options="
--quiet --verbose --append --upload-pack --force --keep --depth=
--tags --no-tags
@@ -1172,11 +1192,7 @@ _git_mergetool ()
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--tool=*)
- __gitcomp "
- kdiff3 tkdiff meld xxdiff emerge
- vimdiff gvimdiff ecmerge diffuse
- opendiff
- " "" "${cur##--tool=}"
+ __gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}"
return
;;
--*)
@@ -1901,6 +1917,7 @@ _git ()
config) _git_config ;;
describe) _git_describe ;;
diff) _git_diff ;;
+ difftool) _git_difftool ;;
fetch) _git_fetch ;;
format-patch) _git_format_patch ;;
fsck) _git_fsck ;;