aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-16 19:06:30 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-16 19:06:30 +0000
commit445ff663a9eac36c01da1f214cb8c9592d66742c (patch)
tree3a7ddba2d8524cdcdd883bb96656704cde9bb5d8 /main.c
parent5b77bfd6008789ed36ccd7847b9339dce94a6854 (diff)
downloadmandoc-445ff663a9eac36c01da1f214cb8c9592d66742c.tar.gz
mandoc-445ff663a9eac36c01da1f214cb8c9592d66742c.tar.zst
mandoc-445ff663a9eac36c01da1f214cb8c9592d66742c.zip
Introduce a new mandoc(1) message level, -W style, below -W warning.
Switch -W all from meaning -W warning to meaning -W style. The meaning of -T lint does *not* change, it still implies -W warning. No messages on the new level yet, but they will come. Usually, i do not lightly make the user interface larger. But this has been planned for years, and EXIT STATUS 1 was reserved for it all the time. The message system is now stable enough to finally implement it. jmc@ regarding the concept: "really good idea"
Diffstat (limited to 'main.c')
-rw-r--r--main.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/main.c b/main.c
index 99daeeca..a58b4ccd 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.289 2017/04/18 16:01:20 schwarze Exp $ */
+/* $Id: main.c,v 1.290 2017/05/16 19:06:30 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -968,15 +968,16 @@ static int
woptions(struct curparse *curp, char *arg)
{
char *v, *o;
- const char *toks[7];
+ const char *toks[8];
toks[0] = "stop";
toks[1] = "all";
- toks[2] = "warning";
- toks[3] = "error";
- toks[4] = "unsupp";
- toks[5] = "fatal";
- toks[6] = NULL;
+ toks[2] = "style";
+ toks[3] = "warning";
+ toks[4] = "error";
+ toks[5] = "unsupp";
+ toks[6] = "fatal";
+ toks[7] = NULL;
while (*arg) {
o = arg;
@@ -986,15 +987,18 @@ woptions(struct curparse *curp, char *arg)
break;
case 1:
case 2:
- curp->wlevel = MANDOCLEVEL_WARNING;
+ curp->wlevel = MANDOCLEVEL_STYLE;
break;
case 3:
- curp->wlevel = MANDOCLEVEL_ERROR;
+ curp->wlevel = MANDOCLEVEL_WARNING;
break;
case 4:
- curp->wlevel = MANDOCLEVEL_UNSUPP;
+ curp->wlevel = MANDOCLEVEL_ERROR;
break;
case 5:
+ curp->wlevel = MANDOCLEVEL_UNSUPP;
+ break;
+ case 6:
curp->wlevel = MANDOCLEVEL_BADARG;
break;
default:
@@ -1002,7 +1006,6 @@ woptions(struct curparse *curp, char *arg)
return 0;
}
}
-
return 1;
}