{"thread":{"id":"12859","subject":"[PATCH] bash: Add long option completion for 'git send-email'","startedAt":"2008-03-25T19:15:55Z","lastAt":"2008-03-25T19:15:55Z","messageCount":1,"participants":["Teemu Likonen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"73060","messageId":"1206472555-9593-1-git-send-email-tlikonen@iki.fi","threadId":"12859","inReplyTo":null,"subject":"[PATCH] bash: Add long option completion for 'git send-email'","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2008-03-25T19:15:55Z","receivedAt":"2008-03-25T19:15:55Z","isPatch":true,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"Add the following long options to be completed with 'git send-email':\n\n--bcc --cc --cc-cmd --chain-reply-to --compose --dry-run\n--envelope-sender --from --identity --in-reply-to --no-chain-reply-to\n--no-signed-off-by-cc --no-suppress-from --no-thread --quiet\n--signed-off-by-cc --smtp-pass --smtp-server --smtp-server-port\n--smtp-ssl --smtp-user --subject --suppress-cc --suppress-from\n--thread --to\n\nSigned-off-by: Teemu Likonen <tlikonen@iki.fi>\n---\n\nThe shorter options like '--to' and '--cc' are not useful for actual\ncompletion because there are longer options which start with same\nletters (--thread, --cc-cmd). It's still useful to have these shorter\nones shown when user presses TAB key after typing two dashes (--).\n\n\n contrib/completion/git-completion.bash |   20 ++++++++++++++++++++\n 1 files changed, 20 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 5046f69..38a5cdc 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -871,6 +871,24 @@ _git_rebase ()\n \t__gitcomp \"$(__git_refs)\"\n }\n \n+_git_send_email ()\n+{\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--*)\n+\t\t__gitcomp \"--bcc --cc --cc-cmd --chain-reply-to --compose\n+\t\t\t--dry-run --envelope-sender --from --identity\n+\t\t\t--in-reply-to --no-chain-reply-to --no-signed-off-by-cc\n+\t\t\t--no-suppress-from --no-thread --quiet\n+\t\t\t--signed-off-by-cc --smtp-pass --smtp-server\n+\t\t\t--smtp-server-port --smtp-ssl --smtp-user --subject\n+\t\t\t--suppress-cc --suppress-from --thread --to\"\n+\t\treturn\n+\t\t;;\n+\tesac\n+\t__git_complete_file\n+}\n+\n _git_config ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n@@ -1325,6 +1343,7 @@ _git ()\n \trebase)      _git_rebase ;;\n \tremote)      _git_remote ;;\n \treset)       _git_reset ;;\n+\tsend-email)  _git_send_email ;;\n \tshortlog)    _git_shortlog ;;\n \tshow)        _git_show ;;\n \tshow-branch) _git_log ;;\n@@ -1377,6 +1396,7 @@ complete -o default -o nospace -F _git_rebase git-rebase\n complete -o default -o nospace -F _git_config git-config\n complete -o default -o nospace -F _git_remote git-remote\n complete -o default -o nospace -F _git_reset git-reset\n+complete -o default -o nospace -F _git_send_email git-send-email\n complete -o default -o nospace -F _git_shortlog git-shortlog\n complete -o default -o nospace -F _git_show git-show\n complete -o default -o nospace -F _git_stash git-stash\n-- \n1.5.5.rc1.6.g5cc8f\n"}]}