summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mandocdb.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-06-21 16:17:56 +0000
committerschwarze <schwarze@openbsd.org>2014-06-21 16:17:56 +0000
commita060caaaaf9ccf7df1261f038fcd0020c1b430fd (patch)
treefb50a5a22381e45165a5eb30ea5cbb67bbaff842 /usr.bin/mandoc/mandocdb.c
parentfix expected message level (diff)
downloadwireguard-openbsd-a060caaaaf9ccf7df1261f038fcd0020c1b430fd.tar.xz
wireguard-openbsd-a060caaaaf9ccf7df1261f038fcd0020c1b430fd.zip
Prefix messages about bad command line options and arguments
with "mandoc: " or "makewhatis: ", respectively, similar to what we already do for other messages.
Diffstat (limited to 'usr.bin/mandoc/mandocdb.c')
-rw-r--r--usr.bin/mandoc/mandocdb.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c
index 22636e4f514..589713b52ec 100644
--- a/usr.bin/mandoc/mandocdb.c
+++ b/usr.bin/mandoc/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.110 2014/06/20 01:20:55 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.111 2014/06/21 16:17:56 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -347,7 +347,8 @@ mandocdb(int argc, char *argv[])
*/
#define CHECKOP(_op, _ch) do \
if (OP_DEFAULT != (_op)) { \
- fprintf(stderr, "-%c: Conflicting option\n", (_ch)); \
+ fprintf(stderr, "%s: -%c: Conflicting option\n", \
+ progname, (_ch)); \
goto usage; \
} while (/*CONSTCOND*/0)
@@ -383,8 +384,9 @@ mandocdb(int argc, char *argv[])
break;
case 'T':
if (strcmp(optarg, "utf8")) {
- fprintf(stderr, "-T%s: Unsupported "
- "output format\n", optarg);
+ fprintf(stderr, "%s: -T%s: "
+ "Unsupported output format\n",
+ progname, optarg);
goto usage;
}
write_utf8 = 1;
@@ -411,7 +413,8 @@ mandocdb(int argc, char *argv[])
argv += optind;
if (OP_CONFFILE == op && argc > 0) {
- fprintf(stderr, "-C: Too many arguments\n");
+ fprintf(stderr, "%s: -C: Too many arguments\n",
+ progname);
goto usage;
}