diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-06-20 23:02:31 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-06-20 23:02:31 +0000 |
commit | b4c01f5c60dab8debad192bef6f9db1c465255b9 (patch) | |
tree | e78d628565794d197118e581bb2357acd6ba5f4f /mandoc.1 | |
parent | b3b89a43d7165af5fd4fe84f88cdeef6cb5ee1aa (diff) | |
download | mandoc-b4c01f5c60dab8debad192bef6f9db1c465255b9.tar.gz mandoc-b4c01f5c60dab8debad192bef6f9db1c465255b9.tar.zst mandoc-b4c01f5c60dab8debad192bef6f9db1c465255b9.zip |
As suggested by jmc@, only include line and column numbers into messages
when they are meaningful, to avoid confusing stuff like this:
$ mandoc /dev/null
mandoc: /dev/null:0:1: FATAL: not a manual
Instead, just say:
mandoc: /dev/null: FATAL: not a manual
Another example this applies to is documents having a prologue,
but lacking a body. Do not throw a FATAL error for these; instead,
issue a WARNING and show the empty document, in the man(7) case with
the same amount of blank lines as groff does. Also downgrade mdoc(7)
documents having content before the first .Sh from FATAL to WARNING.
Diffstat (limited to 'mandoc.1')
-rw-r--r-- | mandoc.1 | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -1,4 +1,4 @@ -.\" $Id: mandoc.1,v 1.103 2013/07/13 19:41:16 schwarze Exp $ +.\" $Id: mandoc.1,v 1.104 2014/06/20 23:02:31 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2012 Ingo Schwarze <schwarze@openbsd.org> @@ -15,7 +15,7 @@ .\" 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 13 2013 $ +.Dd $Mdocdate: June 20 2014 $ .Dt MANDOC 1 .Os .Sh NAME @@ -498,9 +498,7 @@ parser: .Sh DIAGNOSTICS Standard error messages reporting parsing errors are prefixed by .Pp -.Sm off -.D1 Ar file : line : column : \ level : -.Sm on +.D1 Nm Ns : Ar file : Ns Ar line : Ns Ar column : level : .Pp where the fields have the following meanings: .Bl -tag -width "column" @@ -518,6 +516,12 @@ points to the first character of the word. The message level, printed in capital letters. .El .Pp +The +.Ar line +and +.Ar column +fields are omitted when meaningless. +.Pp Message levels have the following meanings: .Bl -tag -width "warning" .It Cm fatal @@ -557,7 +561,7 @@ The utility may also print messages related to invalid command line arguments or operating system errors, for example when memory is exhausted or input files cannot be read. -Such messages do not carry the prefix described above. +Such messages may not carry the prefix described above. .Sh COMPATIBILITY This section summarises .Nm |