From a699367bb8749a338aefb092c5d7ac75c69d61e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= Date: Mon, 31 Jan 2022 22:07:46 +0000 Subject: i18n: factorize more 'incompatible options' messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- parse-options.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'parse-options.h') 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" -- cgit v1.2.3