@matheusbsbs / matheus-bagliano / commits / ae616de6d5
Fork 0

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 <bebarino@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stephen Boyd committed May 3, 2009 at 23:25 UTC ae616de6d53ef14ba11d2aa32f366086c1435dfa
1 file changed +36 -3
contrib/completion/git-completion.bash
+36 -3
@@ -1282,18 +1282,39 @@ _git_rebase ()
1282 __gitcomp "$(__git_refs)"
1283 }
1284
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 +
1288 _git_send_email ()
1289 {
1290 local cur="${COMP_WORDS[COMP_CWORD]}"
1291 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 + ;;
1309 --*)
1310 __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
1313 --in-reply-to --no-chain-reply-to --no-signed-off-by-cc
1314 --no-suppress-from --no-thread --quiet
1315 --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
1318 --validate --no-validate"
1319 return
1320 ;;
@@ -1355,6 +1376,18 @@ _git_config ()
1376 __gitcomp "$__git_log_date_formats"
1377 return
1378 ;;
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 + ;;
1391 *.*)
1392 COMPREPLY=()
1393 return