From d11be70aced0438a57958154b9abf75c30743b39 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Tue, 9 Dec 2008 00:27:17 +0000 Subject: *** empty log message *** --- mdocml.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'mdocml.c') 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); } + -- cgit