summaryrefslogtreecommitdiffstats
path: root/main.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 /main.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 'main.c')
-rw-r--r--main.c16
1 files changed, 10 insertions, 6 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);
}
}