summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-05-20 20:40:02 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-05-21 13:23:14 +0900
commit1b81d8cb19d8da6d865b7fca5a095dd5fec8d209 (patch)
treef2e9df53830c97ecdc6c77e942feda9816eb9166 /contrib/completion/git-completion.bash
parenthelp: add "-a --verbose" to list all commands with synopsis (diff)
downloadtgif-1b81d8cb19d8da6d865b7fca5a095dd5fec8d209.tar.xz
help: use command-list.txt for the source of guides
The help command currently hard codes the list of guides and their summary in C. Let's move this list to command-list.txt. This lets us extract summary lines from Documentation/git*.txt. This also potentially lets us list guides in git.txt, but I'll leave that for now. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rw-r--r--contrib/completion/git-completion.bash15
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 62ca8641f4..4e724a5b76 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1575,6 +1575,13 @@ _git_grep ()
__git_complete_refs
}
+__git_all_guides=
+__git_compute_all_guides ()
+{
+ test -n "$__git_all_guides" ||
+ __git_all_guides=$(git --list-cmds=list-guide)
+}
+
_git_help ()
{
case "$cur" in
@@ -1584,11 +1591,9 @@ _git_help ()
;;
esac
__git_compute_all_commands
- __gitcomp "$__git_all_commands $(__git_aliases)
- attributes cli core-tutorial cvs-migration
- diffcore everyday gitk glossary hooks ignore modules
- namespaces repository-layout revisions tutorial tutorial-2
- workflows
+ __git_compute_all_guides
+ __gitcomp "$__git_all_commands $(__git_aliases) $__git_all_guides
+ gitk
"
}