i18n: factorize more 'incompatible options' messages

Find more incompatible options to factorize.

When more than two options are mutually exclusive, print the ones
which are actually on the command line.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jean-Noël Avila
2022-01-31 22:07:46 +00:00
committed by Junio C Hamano
parent 5d01301f2b
commit a699367bb8
8 changed files with 79 additions and 32 deletions

View File

@@ -225,6 +225,22 @@ NORETURN void usage_msg_opt(const char *msg,
const char * const *usagestr,
const struct option *options);
void die_for_incompatible_opt4(int opt1, const char *opt1_name,
int opt2, const char *opt2_name,
int opt3, const char *opt3_name,
int opt4, const char *opt4_name);
static inline void die_for_incompatible_opt3(int opt1, const char *opt1_name,
int opt2, const char *opt2_name,
int opt3, const char *opt3_name)
{
die_for_incompatible_opt4(opt1, opt1_name,
opt2, opt2_name,
opt3, opt3_name,
0, "");
}
/*
* Use these assertions for callbacks that expect to be called with NONEG and
* NOARG respectively, and do not otherwise handle the "unset" and "arg"