From 445ff663a9eac36c01da1f214cb8c9592d66742c Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 16 May 2017 19:06:30 +0000 Subject: 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" --- main.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'main.c') 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 * Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze @@ -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; } -- cgit v1.2.3