From: Wiktor Mis <mwiktor023@gmail.com>
"git" itself has completion for long options and cmds, but not short ones
Signed-off-by: Wiktor Mis <mwiktor023@gmail.com>
---
Add completion for short optionsPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2100%2FWiktorro%2Fpatch-3-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2100/Wiktorro/patch-3-v2
Pull-Request: https://github.com/git/git/pull/2100
Range-diff vs v1:
1: 1b15a0b458 ! 1: e6161ffe3b Add completion for short options
@@ Metadata
Author: Wiktor Mis <mwiktor023@gmail.com>
## Commit message ##
- Add completion for short options
+ completion: complete "git -<TAB>" with short options
- Git provided completion for long options but not the short ones
+ "git" itself has completion for long options and cmds, but not short ones
Signed-off-by: Wiktor Mis <mwiktor023@gmail.com>
## contrib/completion/git-completion.bash ##
@@ contrib/completion/git-completion.bash: __git_main ()
- --help
- "
;;
+ esac
+ case "$cur" in
+- --*)
+ -*)
-+ __gitcomp "
+ __gitcomp "
+ --paginate
+ --no-pager
+@@ contrib/completion/git-completion.bash: __git_main ()
+ --namespace=
+ --no-replace-objects
+ --help
+ -C
+ -P
+ -c
+ -h
+ -p
+ -v
-+ "
-+ ;;
+ "
+ ;;
*)
- if test -n "${GIT_TESTING_PORCELAIN_COMMAND_LIST-}"
- then contrib/completion/git-completion.bash | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)