diff options
author | Thiago Perrotta <tbperrotta@gmail.com> | 2021-10-25 21:27:06 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-28 16:04:24 (GMT) |
commit | 2b7b75850c6cffba3f33ce99e23bd05f95640e3f (patch) | |
tree | b97dd879d77772d932d55cb263050c7bb6d5f9ab /contrib/completion/git-completion.bash | |
parent | 99c99ed8259bf070cd8ae7b51a94904b7cf5c161 (diff) | |
download | git-2b7b75850c6cffba3f33ce99e23bd05f95640e3f.zip git-2b7b75850c6cffba3f33ce99e23bd05f95640e3f.tar.gz git-2b7b75850c6cffba3f33ce99e23bd05f95640e3f.tar.bz2 |
send-email: programmatically generate bash completions
"git send-email --git-completion-helper" only prints "format-patch"
flags. Make it print "send-email" flags as well, extracting them
programmatically from its three existing "GetOptions".
Introduce a "uniq" subroutine, otherwise --cc-cover, --to-cover and
other flags would show up twice. In addition, deduplicate flags common
to both "send-email" and "format-patch", like --from.
Remove extraneous flags: --h and --git-completion-helper.
Add trailing "=" to options that expect an argument, inline with
the format-patch implementation.
Add a completion test for "send-email --validate", a send-email flag.
Signed-off-by: Thiago Perrotta <tbperrotta@gmail.com>
Based-on-patch-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rw-r--r-- | contrib/completion/git-completion.bash | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 8108eda..183b423 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2359,16 +2359,7 @@ _git_send_email () return ;; --*) - __gitcomp_builtin send-email "--annotate --bcc --cc --cc-cmd --chain-reply-to - --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 --reply-to - --signed-off-by-cc --smtp-pass --smtp-server - --smtp-server-port --smtp-encryption= --smtp-user - --subject --suppress-cc= --suppress-from --thread --to - --validate --no-validate - $__git_format_patch_extra_options" + __gitcomp_builtin send-email "$__git_format_patch_extra_options" return ;; esac |