Skip to content

Commit ae616de

Browse files
bebarinogitster
authored andcommitted
completion: complete values for send-email
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 <[email protected]> Acked-by: Shawn O. Pearce <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 672c68c commit ae616de

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

contrib/completion/git-completion.bash

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,18 +1282,39 @@ _git_rebase ()
12821282
__gitcomp "$(__git_refs)"
12831283
}
12841284

1285+
__git_send_email_confirm_options="always never auto cc compose"
1286+
__git_send_email_suppresscc_options="author self cc ccbody sob cccmd body all"
1287+
12851288
_git_send_email ()
12861289
{
12871290
local cur="${COMP_WORDS[COMP_CWORD]}"
12881291
case "$cur" in
1292+
--confirm=*)
1293+
__gitcomp "
1294+
$__git_send_email_confirm_options
1295+
" "" "${cur##--confirm=}"
1296+
return
1297+
;;
1298+
--suppress-cc=*)
1299+
__gitcomp "
1300+
$__git_send_email_suppresscc_options
1301+
" "" "${cur##--suppress-cc=}"
1302+
1303+
return
1304+
;;
1305+
--smtp-encryption=*)
1306+
__gitcomp "ssl tls" "" "${cur##--smtp-encryption=}"
1307+
return
1308+
;;
12891309
--*)
12901310
__gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to
1291-
--compose --dry-run --envelope-sender --from --identity
1311+
--compose --confirm= --dry-run --envelope-sender
1312+
--from --identity
12921313
--in-reply-to --no-chain-reply-to --no-signed-off-by-cc
12931314
--no-suppress-from --no-thread --quiet
12941315
--signed-off-by-cc --smtp-pass --smtp-server
1295-
--smtp-server-port --smtp-ssl --smtp-user --subject
1296-
--suppress-cc --suppress-from --thread --to
1316+
--smtp-server-port --smtp-encryption= --smtp-user
1317+
--subject --suppress-cc= --suppress-from --thread --to
12971318
--validate --no-validate"
12981319
return
12991320
;;
@@ -1355,6 +1376,18 @@ _git_config ()
13551376
__gitcomp "$__git_log_date_formats"
13561377
return
13571378
;;
1379+
sendemail.aliasesfiletype)
1380+
__gitcomp "mutt mailrc pine elm gnus"
1381+
return
1382+
;;
1383+
sendemail.confirm)
1384+
__gitcomp "$__git_send_email_confirm_options"
1385+
return
1386+
;;
1387+
sendemail.suppresscc)
1388+
__gitcomp "$__git_send_email_suppresscc_options"
1389+
return
1390+
;;
13581391
*.*)
13591392
COMPREPLY=()
13601393
return

0 commit comments

Comments
 (0)