]> git.ipfire.org Git - thirdparty/git.git/blobdiff - parse-options.h
http: replace hard-coded constant with the_hash_algo
[thirdparty/git.git] / parse-options.h
index 7d83e2971d9afa11b11d6187bd96afb88cbb6118..74cce4e7fce74237292e0b34bec2b02e0e945ca7 100644 (file)
@@ -222,6 +222,17 @@ const char *optname(const struct option *opt, int flags);
                BUG("option callback does not expect an argument"); \
 } while (0)
 
+/*
+ * Similar to the assertions above, but checks that "arg" is always non-NULL.
+ * This assertion also implies BUG_ON_OPT_NEG(), letting you declare both
+ * assertions in a single line.
+ */
+#define BUG_ON_OPT_NEG_NOARG(unset, arg) do { \
+       BUG_ON_OPT_NEG(unset); \
+       if(!(arg)) \
+               BUG("option callback expects an argument"); \
+} while(0)
+
 /*----- incremental advanced APIs -----*/
 
 enum parse_opt_result {