Originally, naddy@ requested this in 2011 (or maybe even earlier).
It was discussed with joerg@, kristaps@, naddy@, and espie@ in 2011,
and everybody agreed in principle, but it was postponed because
kristaps@ wanted to do some cleanup of the message system first.
Meanwhile, message infrastructure was improved about a dozen times...
This makes long, tedious commands like "mandoc -Tlint *.1 2>&1 | less"
unnecessary and allows simple ones like "man -l -Tlint *.1".
************************************************************************
* Official mandoc TODO.
************************************************************************
* Official mandoc TODO.
-* $Id: TODO,v 1.242 2017/07/20 12:54:02 schwarze Exp $
+* $Id: TODO,v 1.243 2017/07/20 15:26:41 schwarze Exp $
************************************************************************
Many issues are annotated for difficulty as follows:
************************************************************************
Many issues are annotated for difficulty as follows:
Probably, this should be fixed somewhere in termp_it_pre(), not sure.
loc * exist ** algo ** size * imp **
Probably, this should be fixed somewhere in termp_it_pre(), not sure.
loc * exist ** algo ** size * imp **
-- In .Bl -tag, if a tag exceeds the right margin and must be continued
- on the next line, it must be indented by -width, not width+1;
- see "rule block|pass" in OpenBSD ifconfig(8).
- loc * exist *** algo ** size * imp **
-
- When the -width string contains macros, the macros must be rendered
before measuring the width, for example
.Bl -tag -width ".Dv message"
- When the -width string contains macros, the macros must be rendered
before measuring the width, for example
.Bl -tag -width ".Dv message"
but just the overall format
loc ** exist ** algo *** size ** imp **
but just the overall format
loc ** exist ** algo *** size ** imp **
-- -Tlint parser errors and warnings to stdout
- to tech@mdocml, naddy@ Wed, 28 Sep 2011 11:21:46 +0200
- wait! kristaps@ Sun, 02 Oct 2011 17:12:52 +0200
-
************************************************************************
* documentation issues
************************************************************************
************************************************************************
* documentation issues
************************************************************************
-/* $Id: main.c,v 1.299 2017/07/04 14:40:38 schwarze Exp $ */
+/* $Id: main.c,v 1.300 2017/07/20 15:26:41 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
static char help_arg[] = "help";
static char *help_argv[] = {help_arg, NULL};
static enum mandoclevel rc;
static char help_arg[] = "help";
static char *help_argv[] = {help_arg, NULL};
static enum mandoclevel rc;
+static FILE *mmsg_stream;
curp.mmin = MANDOCERR_MAX;
curp.outopts = &conf.output;
options = MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1;
curp.mmin = MANDOCERR_MAX;
curp.outopts = &conf.output;
options = MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1;
use_pager = 1;
tag_files = NULL;
use_pager = 1;
tag_files = NULL;
else if (0 == strcmp(arg, "lint")) {
curp->outtype = OUTT_LINT;
curp->mmin = MANDOCERR_BASE;
else if (0 == strcmp(arg, "lint")) {
curp->outtype = OUTT_LINT;
curp->mmin = MANDOCERR_BASE;
} else if (0 == strcmp(arg, "tree"))
curp->outtype = OUTT_TREE;
else if (0 == strcmp(arg, "man"))
} else if (0 == strcmp(arg, "tree"))
curp->outtype = OUTT_TREE;
else if (0 == strcmp(arg, "man"))
{
const char *mparse_msg;
{
const char *mparse_msg;
- fprintf(stderr, "%s: %s:", getprogname(),
+ fprintf(mmsg_stream, "%s: %s:", getprogname(),
file == NULL ? "<stdin>" : file);
if (line)
file == NULL ? "<stdin>" : file);
if (line)
- fprintf(stderr, "%d:%d:", line, col + 1);
+ fprintf(mmsg_stream, "%d:%d:", line, col + 1);
- fprintf(stderr, " %s", mparse_strlevel(lvl));
+ fprintf(mmsg_stream, " %s", mparse_strlevel(lvl));
if ((mparse_msg = mparse_strerror(t)) != NULL)
if ((mparse_msg = mparse_strerror(t)) != NULL)
- fprintf(stderr, ": %s", mparse_msg);
+ fprintf(mmsg_stream, ": %s", mparse_msg);
- fprintf(stderr, ": %s", msg);
+ fprintf(mmsg_stream, ": %s", msg);
+ fputc('\n', mmsg_stream);
-.\" $Id: mandoc.1,v 1.216 2017/07/07 16:20:30 schwarze Exp $
+.\" $Id: mandoc.1,v 1.217 2017/07/20 15:26:41 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2012, 2014-2017 Ingo Schwarze <schwarze@openbsd.org>
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: July 7 2017 $
+.Dd $Mdocdate: July 20 2017 $
.Dt MANDOC 1
.Os
.Sh NAME
.Dt MANDOC 1
.Os
.Sh NAME
.It Fl T Cm lint
Parse only: produce no output.
Implies
.It Fl T Cm lint
Parse only: produce no output.
Implies
+.Fl W Cm all
+and redirects parser messages, which usually appear
+on standard error output, to standard output.
.It Fl T Cm locale
Encode output using the current locale.
This is the default.
.It Fl T Cm locale
Encode output using the current locale.
This is the default.