summaryrefslogtreecommitdiff
path: root/parse-options.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse-options.c')
-rw-r--r--parse-options.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/parse-options.c b/parse-options.c
index a8283037be..2437ad3bcd 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -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);
+}