* mdocml: Prefix messages about bad command line options and arguments
@ 2014-06-21 16:18 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-06-21 16:18 UTC (permalink / raw)
To: source
Log Message:
-----------
Prefix messages about bad command line options and arguments
with "mandoc: " or "makewhatis: ", respectively,
similar to what we already do for other messages.
Modified Files:
--------------
mdocml:
main.c
mandocdb.c
Revision Data
-------------
Index: mandocdb.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.152 -r1.153
--- mandocdb.c
+++ 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;
}
Index: main.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/main.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -Lmain.c -Lmain.c -u -p -r1.175 -r1.176
--- main.c
+++ 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 *ar
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 *ar
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);
}
}
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-06-21 16:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-21 16:18 mdocml: Prefix messages about bad command line options and arguments schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).