summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-06-21 16:18:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-06-21 16:18:25 +0000
commitfc390ff3f226de8ab205d632e190100023030fef (patch)
tree7f75f8da00d371d2c94ae5fb40b6e4aa4fc32bb9 /mandocdb.c
parent37fc9452eae26c51be7df689f984abae6d78ccea (diff)
downloadmandoc-fc390ff3f226de8ab205d632e190100023030fef.tar.gz
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 'mandocdb.c')
-rw-r--r--mandocdb.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mandocdb.c b/mandocdb.c
index de0bee03..2cbf0e9e 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -355,7 +355,8 @@ main(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)
@@ -391,8 +392,9 @@ main(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;
@@ -419,7 +421,8 @@ main(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;
}