git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/5] completion: complete values for send-email

From
Stephen Boyd <bebarino@gmail.com>
Date
May 4, 2009, 06:25 UTC
Message-ID
<1241418335-18474-5-git-send-email-bebarino@gmail.com>
In-Reply-To
<1241418335-18474-4-git-send-email-bebarino@gmail.com>

Add completion for --confirm, --suppress-cc, and --smtp-encryption command line arguments. Add completion for aliasfiletype and confirm configuration variables.

Since --smtp-ssl is deprecated, replace it with --smtp-encryption and the two options ssl and tls.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
 contrib/completion/git-completion.bash |   39 +++++++++++++++++++++++++++++--
 1 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index d67ffd9..1683e6d 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1282,18 +1282,39 @@ _git_rebase ()
 	__gitcomp "$(__git_refs)"
 }
 
+__git_send_email_confirm_options="always never auto cc compose"
+__git_send_email_suppresscc_options="author self cc ccbody sob cccmd body all"
+
 _git_send_email ()
 {
 	local cur="${COMP_WORDS[COMP_CWORD]}"
 	case "$cur" in
+	--confirm=*)
+		__gitcomp "
+			$__git_send_email_confirm_options
+			" "" "${cur##--confirm=}"
+		return
+		;;
+	--suppress-cc=*)
+		__gitcomp "
+			$__git_send_email_suppresscc_options
+			" "" "${cur##--suppress-cc=}"
+
+		return
+		;;
+	--smtp-encryption=*)
+		__gitcomp "ssl tls" "" "${cur##--smtp-encryption=}"
+		return
+		;;
 	--*)
 		__gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to
-			--compose --dry-run --envelope-sender --from --identity
+			--compose --confirm= --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
+			--smtp-server-port --smtp-encryption= --smtp-user
+			--subject --suppress-cc= --suppress-from --thread --to
 			--validate --no-validate"
 		return
 		;;
@@ -1355,6 +1376,18 @@ _git_config ()
 		__gitcomp "$__git_log_date_formats"
 		return
 		;;
+	sendemail.aliasesfiletype)
+		__gitcomp "mutt mailrc pine elm gnus"
+		return
+		;;
+	sendemail.confirm)
+		__gitcomp "$__git_send_email_confirm_options"
+		return
+		;;
+	sendemail.suppresscc)
+		__gitcomp "$__git_send_email_suppresscc_options"
+		return
+		;;
 	*.*)
 		COMPREPLY=()
 		return
-- 
1.6.2.3
Previous: Stephen BoydNext: Shawn O. Pearce
Message 5 of 6 in “completion: add missing configuration variables to _git_config()”
  1. 1/5 completion: add missing configuration variables to _git_config()Stephen Boyd, May 4, 2009
  2. 2/5 completion: add {gui,diff,merge}tool, man, and pager config variablesStephen Boyd, May 4, 2009
  3. 3/5 completion: complete values for help.formatStephen Boyd, May 4, 2009
  4. 4/5 completion: complete values for log.dateStephen Boyd, May 4, 2009
  5. 5/5 completion: complete values for send-emailStephen Boyd, May 4, 2009
  6. Shawn O. PearceMay 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.