]> git.ipfire.org Git - thirdparty/git.git/blobdiff - parse-options.c
Merge branch 'en/fetch-negotiation-default-fix'
[thirdparty/git.git] / parse-options.c
index a8283037be966596184862aa358bff6fd37194f3..2437ad3bcdd5b6ff06bf3f46fb00a1106958cca3 100644 (file)
@@ -1079,3 +1079,16 @@ void NORETURN usage_msg_opt(const char *msg,
        die_message("%s\n", msg); /* The extra \n is intentional */
        usage_with_options(usagestr, options);
 }
+
+void NORETURN usage_msg_optf(const char * const fmt,
+                            const char * const *usagestr,
+                            const struct option *options, ...)
+{
+       struct strbuf msg = STRBUF_INIT;
+       va_list ap;
+       va_start(ap, options);
+       strbuf_vaddf(&msg, fmt, ap);
+       va_end(ap);
+
+       usage_msg_opt(msg.buf, usagestr, options);
+}