diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-24 15:59:50 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-24 15:59:50 +0000 |
commit | 0b89278a4977fe96cec8e2c06f4627e2e6b5c20f (patch) | |
tree | e22ec96df0f4796551f3388fefa635537c13371e | |
parent | 07569d42d40c11c0305c5b07d2c1bbb04047c52f (diff) | |
download | mandoc-0b89278a4977fe96cec8e2c06f4627e2e6b5c20f.tar.gz |
in the base system, suggest leaving .Os blank; inspired by mdoclint
-rw-r--r-- | mandoc.1 | 6 | ||||
-rw-r--r-- | mandoc.h | 1 | ||||
-rw-r--r-- | mdoc_validate.c | 7 | ||||
-rw-r--r-- | read.c | 1 |
4 files changed, 15 insertions, 0 deletions
@@ -816,6 +816,12 @@ macro does not use CVS keyword substitution, but using it is conventionally expected in the .Ox base system. +.It Sy "operating system explicitly specified" +.Pq mdoc , Ox , Nx +The +.Ic \&Os +macro has an argument. +In the base system, it is conventionally left blank. .It Sy "RCS id missing" .Pq Ox , Nx The manual page lacks the comment line with the RCS identifier @@ -48,6 +48,7 @@ enum mandocerr { MANDOCERR_MDOCDATE, /* Mdocdate found: Dd ... */ MANDOCERR_MDOCDATE_MISSING, /* Mdocdate missing: Dd ... */ + MANDOCERR_OS_ARG, /* operating system explicitly specified: Os ... */ MANDOCERR_RCS_MISSING, /* RCS id missing */ MANDOCERR_STYLE, /* ===== start of style suggestions ===== */ diff --git a/mdoc_validate.c b/mdoc_validate.c index 731b63c6..3f5387f4 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -2584,6 +2584,13 @@ out: * the operating system earlier. */ + if (n->child != NULL) + mandoc_vmsg(MANDOCERR_OS_ARG, mdoc->parse, + n->child->line, n->child->pos, + "Os %s (%s)", n->child->string, + mdoc->meta.os_e == MANDOC_OS_OPENBSD ? + "OpenBSD" : "NetBSD"); + while (n->tok != MDOC_Dd) if ((n = n->prev) == NULL) return; @@ -90,6 +90,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "Mdocdate found", "Mdocdate missing", + "operating system explicitly specified", "RCS id missing", "generic style suggestion", |