aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-01-27 13:47:10 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-01-27 13:47:10 +0000
commita691b01d3c341059f53c726943f9381943abe885 (patch)
tree7bb1fa0b30f9625d13af868270a43bfa30433d27 /main.c
parentdba36350d7b2c68fca35f6b5c95e565cae8a747b (diff)
downloadmandoc-a691b01d3c341059f53c726943f9381943abe885.tar.gz
mandoc-a691b01d3c341059f53c726943f9381943abe885.tar.zst
mandoc-a691b01d3c341059f53c726943f9381943abe885.zip
warn about invalid output options
and error out if they occur on the command line; missing feature found in the TODO file
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/main.c b/main.c
index b64b3be1..1b1b5b73 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.279 2017/01/09 17:49:57 schwarze Exp $ */
+/* $Id: main.c,v 1.280 2017/01/27 13:47:10 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -123,6 +123,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;
@@ -247,9 +248,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;