summaryrefslogtreecommitdiff
path: root/parse-options.h
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2025-02-06 07:33:34 +0100
committerJunio C Hamano <gitster@pobox.com>2025-02-06 12:23:54 -0800
commit9144b9362b2ed972f5886dcc7beee6a2acce2708 (patch)
tree843fbc779c26450b5299dade9feafbd4e13f09a1 /parse-options.h
parent7a52a8c7d855d3ed779059af160248934ac2c6b0 (diff)
parse-options: introduce die_for_incompatible_opt2()
The functions die_for_incompatible_opt3() and die_for_incompatible_opt4() already exist to die whenever a user specifies three or four options respectively that are not compatible. Introduce die_for_incompatible_opt2() which dies when two options that are incompatible are set. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/parse-options.h b/parse-options.h
index 39f0886254..fca944d9a9 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -436,6 +436,15 @@ static inline void die_for_incompatible_opt3(int opt1, const char *opt1_name,
0, "");
}
+static inline void die_for_incompatible_opt2(int opt1, const char *opt1_name,
+ int opt2, const char *opt2_name)
+{
+ die_for_incompatible_opt4(opt1, opt1_name,
+ opt2, opt2_name,
+ 0, "",
+ 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"