@matheusbsbs / matheus-bagliano / commits / 25a1f374f0
Fork 0

bash: Add long option completion for 'git send-email'

Add the following long options to be completed with 'git send-email': --bcc --cc --cc-cmd --chain-reply-to --compose --dry-run --envelope-sender --from --identity --in-reply-to --no-chain-reply-to --no-signed-off-by-cc --no-suppress-from --no-thread --quiet --signed-off-by-cc --smtp-pass --smtp-server --smtp-server-port --smtp-ssl --smtp-user --subject --suppress-cc --suppress-from --thread --to Short ones like --to and --cc are not usable for actual completion because of the shortness itself and because there are longer ones which start with same letters (--thread, --compose). It's still useful to have these shorter options _listed_ when user presses TAB key after typing two dashes. It gives user an idea what options are available (and --to and --cc are probably the most commonly used). Signed-off-by: Teemu Likonen <tlikonen@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Teemu Likonen committed Jul 14, 2008 at 11:21 UTC 25a1f374f0ff23a4d9191436226ab68f3da5e83a
1 file changed +20
contrib/completion/git-completion.bash
+20
@@ -905,6 +905,24 @@ _git_rebase ()
905 __gitcomp "$(__git_refs)"
906 }
907
908 +_git_send_email ()
909 +{
910 + local cur="${COMP_WORDS[COMP_CWORD]}"
911 + case "$cur" in
912 + --*)
913 + __gitcomp "--bcc --cc --cc-cmd --chain-reply-to --compose
914 + --dry-run --envelope-sender --from --identity
915 + --in-reply-to --no-chain-reply-to --no-signed-off-by-cc
916 + --no-suppress-from --no-thread --quiet
917 + --signed-off-by-cc --smtp-pass --smtp-server
918 + --smtp-server-port --smtp-ssl --smtp-user --subject
919 + --suppress-cc --suppress-from --thread --to"
920 + return
921 + ;;
922 + esac
923 + COMPREPLY=()
924 +}
925 +
926 _git_config ()
927 {
928 local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -1376,6 +1394,7 @@ _git ()
1394 rebase) _git_rebase ;;
1395 remote) _git_remote ;;
1396 reset) _git_reset ;;
1397 + send-email) _git_send_email ;;
1398 shortlog) _git_shortlog ;;
1399 show) _git_show ;;
1400 show-branch) _git_log ;;
@@ -1435,6 +1454,7 @@ complete -o default -o nospace -F _git_rebase git-rebase
1454 complete -o default -o nospace -F _git_config git-config
1455 complete -o default -o nospace -F _git_remote git-remote
1456 complete -o default -o nospace -F _git_reset git-reset
1457 +complete -o default -o nospace -F _git_send_email git-send-email
1458 complete -o default -o nospace -F _git_shortlog git-shortlog
1459 complete -o default -o nospace -F _git_show git-show
1460 complete -o default -o nospace -F _git_stash git-stash