=================================================================== RCS file: /cvs/mandoc/main.c,v retrieving revision 1.273.2.4 retrieving revision 1.273.2.6 diff -u -p -r1.273.2.4 -r1.273.2.6 --- mandoc/main.c 2017/01/09 17:57:15 1.273.2.4 +++ mandoc/main.c 2017/02/10 15:57:47 1.273.2.6 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.273.2.4 2017/01/09 17:57:15 schwarze Exp $ */ +/* $Id: main.c,v 1.273.2.6 2017/02/10 15:57:47 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze @@ -125,6 +125,7 @@ main(int argc, char *argv[]) struct manpage *res, *resp; char *conf_file, *defpaths; const char *sec; + const char *thisarg; size_t i, sz; int prio, best_prio; enum outmode outmode; @@ -251,9 +252,14 @@ main(int argc, char *argv[]) break; case 'O': search.outkey = optarg; - while (optarg != NULL) - manconf_output(&conf.output, - strsep(&optarg, ",")); + while (optarg != NULL) { + thisarg = optarg; + if (manconf_output(&conf.output, + strsep(&optarg, ","), 0) == 0) + continue; + warnx("-O %s: Bad argument", thisarg); + return (int)MANDOCLEVEL_BADARG; + } break; case 'S': search.arch = optarg; @@ -757,7 +763,8 @@ parse(struct curparse *curp, int fd, const char *file) if (man == NULL) return; if (man->macroset == MACROSET_MDOC) { - mdoc_validate(man); + if (curp->outtype != OUTT_TREE || !curp->outopts->noval) + mdoc_validate(man); switch (curp->outtype) { case OUTT_HTML: html_mdoc(curp->outdata, man); @@ -780,7 +787,8 @@ parse(struct curparse *curp, int fd, const char *file) } } if (man->macroset == MACROSET_MAN) { - man_validate(man); + if (curp->outtype != OUTT_TREE || !curp->outopts->noval) + man_validate(man); switch (curp->outtype) { case OUTT_HTML: html_man(curp->outdata, man);