]> git.ipfire.org Git - thirdparty/git.git/commit - git-send-email.perl
send-email: programmatically generate bash completions
authorThiago Perrotta <tbperrotta@gmail.com>
Mon, 25 Oct 2021 21:27:06 +0000 (17:27 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Oct 2021 16:04:24 +0000 (09:04 -0700)
commit2b7b75850c6cffba3f33ce99e23bd05f95640e3f
treeb97dd879d77772d932d55cb263050c7bb6d5f9ab
parent99c99ed8259bf070cd8ae7b51a94904b7cf5c161
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>
contrib/completion/git-completion.bash
git-send-email.perl
t/t9902-completion.sh