summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Pawelczyk <przemoc@gmail.com>2018-02-18 22:19:45 +0100
committerPrzemyslaw Pawelczyk <przemoc@gmail.com>2018-02-18 22:19:45 +0100
commitfda0e6a437452639c9b5725a2968676f1870629a (patch)
treea70e73ca819e431a76cd1c8c83dd20233ea8c83a
parenta1984b3ed5b3231d08e21f101999f4bdbf9fa8b9 (diff)
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).
-rw-r--r--src/metastore.c11
1 files 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"