summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.c16
-rw-r--r--mandocdb.c11
2 files changed, 17 insertions, 10 deletions
diff --git a/main.c b/main.c
index c1e5ba9f..c6c92386 100644
--- a/main.c
+++ b/main.c
@@ -108,13 +108,14 @@ main(int argc, char *argv[])
case 'I':
if (strncmp(optarg, "os=", 3)) {
fprintf(stderr,
- "-I%s: Bad argument\n", optarg);
+ "%s: -I%s: Bad argument\n",
+ progname, optarg);
return((int)MANDOCLEVEL_BADARG);
}
if (defos) {
fprintf(stderr,
- "-I%s: Duplicate argument\n",
- optarg);
+ "%s: -I%s: Duplicate argument\n",
+ progname, optarg);
return((int)MANDOCLEVEL_BADARG);
}
defos = mandoc_strdup(optarg + 3);
@@ -324,7 +325,8 @@ moptions(int *options, char *arg)
else if (0 == strcmp(arg, "an"))
*options |= MPARSE_MAN;
else {
- fprintf(stderr, "%s: Bad argument\n", arg);
+ fprintf(stderr, "%s: -m%s: Bad argument\n",
+ progname, arg);
return(0);
}
@@ -357,7 +359,8 @@ toptions(struct curparse *curp, char *arg)
else if (0 == strcmp(arg, "pdf"))
curp->outtype = OUTT_PDF;
else {
- fprintf(stderr, "%s: Bad argument\n", arg);
+ fprintf(stderr, "%s: -T%s: Bad argument\n",
+ progname, arg);
return(0);
}
@@ -395,7 +398,8 @@ woptions(struct curparse *curp, char *arg)
curp->wlevel = MANDOCLEVEL_FATAL;
break;
default:
- fprintf(stderr, "-W%s: Bad argument\n", o);
+ fprintf(stderr, "%s: -W%s: Bad argument\n",
+ progname, o);
return(0);
}
}
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;
}