path: root/parse-options.h
diff options
authorChristian Couder <>2009-02-02 05:12:58 (GMT)
committerJunio C Hamano <>2009-06-01 00:03:40 (GMT)
commit451bb210f81c10b60bf90403c9183be26beaaabf (patch)
tree7f65acf1d82dac05446baea45684349cfaa3874a /parse-options.h
parentbebdd271ff660d603ad75fef346ad1ff19fca0cb (diff)
parse-options: add new function "usage_msg_opt"
This function can be used instead of "usage_with_options" when you want to print an error message before the usage string. It may be useful because: if (condition) usage_msg_opt("condition is false", usage, opts); is shorter than: if (condition) { fprintf(stderr, "condition is false\n\n"); usage_with_options(usage, opts); } and may be more consistent. Signed-off-by: Christian Couder <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'parse-options.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/parse-options.h b/parse-options.h
index b374ade..f0f885c 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -132,6 +132,10 @@ extern int parse_options(int argc, const char **argv, const char *prefix,
extern NORETURN void usage_with_options(const char * const *usagestr,
const struct option *options);
+extern NORETURN void usage_msg_opt(const char *msg,
+ const char * const *usagestr,
+ const struct option *options);
/*----- incremental advanced APIs -----*/
enum {