git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Teemu Likonen <tlikonen@iki.fi>
To: git@vger.kernel.org
Cc: gitster@pobox.com, spearce@spearce.org, Teemu Likonen <tlikonen@iki.fi>
Subject: [PATCH] bash: Add long option completion for 'git send-email'
Date: Tue, 25 Mar 2008 21:15:55 +0200	[thread overview]
Message-ID: <1206472555-9593-1-git-send-email-tlikonen@iki.fi> (raw)

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

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
---

The shorter options like '--to' and '--cc' are not useful for actual
completion because there are longer options which start with same
letters (--thread, --cc-cmd). It's still useful to have these shorter
ones shown when user presses TAB key after typing two dashes (--).


 contrib/completion/git-completion.bash |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 5046f69..38a5cdc 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -871,6 +871,24 @@ _git_rebase ()
 	__gitcomp "$(__git_refs)"
 }
 
+_git_send_email ()
+{
+	local cur="${COMP_WORDS[COMP_CWORD]}"
+	case "$cur" in
+	--*)
+		__gitcomp "--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"
+		return
+		;;
+	esac
+	__git_complete_file
+}
+
 _git_config ()
 {
 	local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -1325,6 +1343,7 @@ _git ()
 	rebase)      _git_rebase ;;
 	remote)      _git_remote ;;
 	reset)       _git_reset ;;
+	send-email)  _git_send_email ;;
 	shortlog)    _git_shortlog ;;
 	show)        _git_show ;;
 	show-branch) _git_log ;;
@@ -1377,6 +1396,7 @@ complete -o default -o nospace -F _git_rebase git-rebase
 complete -o default -o nospace -F _git_config git-config
 complete -o default -o nospace -F _git_remote git-remote
 complete -o default -o nospace -F _git_reset git-reset
+complete -o default -o nospace -F _git_send_email git-send-email
 complete -o default -o nospace -F _git_shortlog git-shortlog
 complete -o default -o nospace -F _git_show git-show
 complete -o default -o nospace -F _git_stash git-stash
-- 
1.5.5.rc1.6.g5cc8f

             reply	other threads:[~2008-03-25 19:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 19:15 Teemu Likonen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-04-27  0:14 [PATCH] git-format-patch: add a new format.cc configuration variable Junio C Hamano
2008-04-27  5:09 ` [PATCH] bash: Add long option completion for 'git send-email' Teemu Likonen
2008-07-14  8:21 Teemu Likonen
2008-07-15  4:38 ` Shawn O. Pearce
2008-07-15  4:49   ` Junio C Hamano
2008-07-15  4:58     ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1206472555-9593-1-git-send-email-tlikonen@iki.fi \
    --to=tlikonen@iki.fi \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).