summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/main.c b/main.c
index 84533fcd..5382d0b2 100644
--- a/main.c
+++ b/main.c
@@ -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;