diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-12-09 00:27:17 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-12-09 00:27:17 +0000 |
commit | d11be70aced0438a57958154b9abf75c30743b39 (patch) | |
tree | b874e910756a425b6e47a90451c20f1701f626c2 /mdocml.c | |
parent | 6aaaf55fc07e369105283ad90562fb1bd4c2d1ee (diff) | |
download | mandoc-d11be70aced0438a57958154b9abf75c30743b39.tar.gz |
*** empty log message ***
Diffstat (limited to 'mdocml.c')
-rw-r--r-- | mdocml.c | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -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); } + |