summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-24 15:59:50 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-24 15:59:50 +0000
commit0b89278a4977fe96cec8e2c06f4627e2e6b5c20f (patch)
treee22ec96df0f4796551f3388fefa635537c13371e
parent07569d42d40c11c0305c5b07d2c1bbb04047c52f (diff)
downloadmandoc-0b89278a4977fe96cec8e2c06f4627e2e6b5c20f.tar.gz
in the base system, suggest leaving .Os blank; inspired by mdoclint
-rw-r--r--mandoc.16
-rw-r--r--mandoc.h1
-rw-r--r--mdoc_validate.c7
-rw-r--r--read.c1
4 files changed, 15 insertions, 0 deletions
diff --git a/mandoc.1 b/mandoc.1
index 11ac4ac3..afdaabe7 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -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
diff --git a/mandoc.h b/mandoc.h
index 166483b3..46a50be8 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -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;
diff --git a/read.c b/read.c
index 061995b9..8f66f9ce 100644
--- a/read.c
+++ b/read.c
@@ -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",