From fda0e6a437452639c9b5725a2968676f1870629a Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Sun, 18 Feb 2018 22:19:45 +0100 Subject: [PATCH] metastore.c: Print usage to stdout if help is requested. Also change level of usage message shown after critical one to error, so it can be suppressed without hiding critical one if desired (-qqq). --- src/metastore.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/metastore.c b/src/metastore.c index 60440b0..6f92f8c 100644 --- a/src/metastore.c +++ b/src/metastore.c @@ -408,12 +408,15 @@ version(void) static void usage(const char *arg0, const char *message) { - if (message) - msg(MSG_CRITICAL, "%s: %s\n\n", arg0, message); - msg(MSG_CRITICAL, + if (message) { + msg(MSG_CRITICAL, "%s: %s\n", arg0, message); + msg(MSG_ERROR, "\n"); + } + + msg(message ? MSG_ERROR : MSG_QUIET, "Usage: %s ACTION [OPTION...] [PATH...]\n", arg0); - msg(MSG_CRITICAL, + msg(message ? MSG_ERROR : MSG_QUIET, "\n" "Where ACTION is one of:\n" " -c, --compare Show differences between stored and real metadata\n" -- 2.11.4.GIT