summaryrefslogtreecommitdiffstats
path: root/mdocml.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-12-09 00:27:17 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-12-09 00:27:17 +0000
commitd11be70aced0438a57958154b9abf75c30743b39 (patch)
treeb874e910756a425b6e47a90451c20f1701f626c2 /mdocml.c
parent6aaaf55fc07e369105283ad90562fb1bd4c2d1ee (diff)
downloadmandoc-d11be70aced0438a57958154b9abf75c30743b39.tar.gz
*** empty log message ***
Diffstat (limited to 'mdocml.c')
-rw-r--r--mdocml.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/mdocml.c b/mdocml.c
index 342e3ebb..a9a7a047 100644
--- a/mdocml.c
+++ b/mdocml.c
@@ -54,8 +54,11 @@ int
main(int argc, char *argv[])
{
int c;
- char *out, *in;
+ char *out, *in, *opts, *v;
struct md_args args;
+#define ALL 0
+#define ERROR 1
+ char *toks[] = { "all", "error", NULL };
extern char *optarg;
extern int optind;
@@ -66,7 +69,7 @@ main(int argc, char *argv[])
args.type = MD_XML;
- while (-1 != (c = getopt(argc, argv, "c:ef:o:vW")))
+ while (-1 != (c = getopt(argc, argv, "c:ef:o:vW:")))
switch (c) {
case ('c'):
if (args.type != MD_HTML)
@@ -93,7 +96,19 @@ main(int argc, char *argv[])
args.verbosity++;
break;
case ('W'):
- args.warnings |= MD_WARN_ALL;
+ opts = optarg;
+ while (*opts)
+ switch (getsubopt(&opts, toks, &v)) {
+ case (ALL):
+ args.warnings |= MD_WARN_ALL;
+ break;
+ case (ERROR):
+ args.warnings |= MD_WARN_ERROR;
+ break;
+ default:
+ usage();
+ return(1);
+ }
break;
default:
usage();
@@ -250,6 +265,7 @@ usage(void)
{
extern char *__progname;
- (void)printf("usage: %s [-vW] [-f filter] [-o outfile] "
- "[infile]\n", __progname);
+ (void)printf("usage: %s [-v] [-Wwarn...] [-f filter] "
+ "[-o outfile] [infile]\n", __progname);
}
+