summaryrefslogtreecommitdiff
path: root/parse-options.h
diff options
context:
space:
mode:
authorJean-Noël Avila <jn.avila@free.fr>2022-01-31 22:07:46 +0000
committerJunio C Hamano <gitster@pobox.com>2022-02-04 13:58:28 -0800
commita699367bb8749a338aefb092c5d7ac75c69d61e1 (patch)
treec09bbd28e122a8a2b718fed0c41fbecd743ad8cf /parse-options.h
parent5d01301f2b865aa8dba1654d3f447ce9d21db0b5 (diff)
downloadgit-a699367bb8749a338aefb092c5d7ac75c69d61e1.tar.gz
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>
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/parse-options.h b/parse-options.h
index e22846d3b7..f773cc7859 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -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"