discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* warn about unknown volume/arch in .Dt macro arguments
@ 2012-10-13 13:23 Nicolas Joly
  2012-11-16 22:23 ` Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Joly @ 2012-10-13 13:23 UTC (permalink / raw)
  To: discuss

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]


Hi,

Please find attached a small patch that i have for quite some time in
my local NetBSD tree that makes mandoc warn about unknown volume/arch
in Dt macro arguments.

njoly@petaure [~]> grep '^\.Dt '/usr/share/man/man8/i386/mbr.8
.Dt MBR 8 i386
njoly@petaure [~]> cat /usr/share/man/man8/i386/mbr.8 | mandoc -Tlint
njoly@petaure [~]> cat /usr/share/man/man8/i386/mbr.8 | sed 's,i386$,dummy,'| mandoc -Tlint
<stdin>:3:11: WARNING: unknown manual volume/arch

Regards.

-- 
Nicolas Joly

Biology IT Center
Institut Pasteur, Paris.

[-- Attachment #2: netbsd-mandocdtwarn.diff --]
[-- Type: text/plain, Size: 2152 bytes --]

Index: external/bsd/mdocml/dist/mandoc.h
===================================================================
RCS file: /cvsroot/src/external/bsd/mdocml/dist/mandoc.h,v
retrieving revision 1.2
diff -u -p -r1.2 mandoc.h
--- external/bsd/mdocml/dist/mandoc.h	16 Feb 2012 20:58:23 -0000	1.2
+++ external/bsd/mdocml/dist/mandoc.h	13 Oct 2012 13:19:12 -0000
@@ -50,6 +50,7 @@ enum	mandocerr {
 	MANDOCERR_NOTITLE, /* no title in document */
 	MANDOCERR_UPPERCASE, /* document title should be all caps */
 	MANDOCERR_BADMSEC, /* unknown manual section */
+	MANDOCERR_BADVOLARCH, /* unknown manual volume/arch */
 	MANDOCERR_NODATE, /* date missing, using today's date */
 	MANDOCERR_BADDATE, /* cannot parse date, using it verbatim */
 	MANDOCERR_PROLOGOOO, /* prologue macros out of order */
Index: external/bsd/mdocml/dist/mdoc_validate.c
===================================================================
RCS file: /cvsroot/src/external/bsd/mdocml/dist/mdoc_validate.c,v
retrieving revision 1.4
diff -u -p -r1.4 mdoc_validate.c
--- external/bsd/mdocml/dist/mdoc_validate.c	30 Jan 2012 17:03:01 -0000	1.4
+++ external/bsd/mdocml/dist/mdoc_validate.c	13 Oct 2012 13:19:12 -0000
@@ -2124,9 +2124,9 @@ post_dt(POST_ARGS)
 		free(mdoc->meta.vol);
 		mdoc->meta.vol = mandoc_strdup(cp);
 	} else {
-		/* FIXME: warn about bad arch. */
 		cp = mdoc_a2arch(nn->string);
 		if (NULL == cp) {
+			mdoc_nmsg(mdoc, nn, MANDOCERR_BADVOLARCH);
 			free(mdoc->meta.vol);
 			mdoc->meta.vol = mandoc_strdup(nn->string);
 		} else 
Index: external/bsd/mdocml/dist/read.c
===================================================================
RCS file: /cvsroot/src/external/bsd/mdocml/dist/read.c,v
retrieving revision 1.6
diff -u -p -r1.6 read.c
--- external/bsd/mdocml/dist/read.c	16 Feb 2012 20:58:23 -0000	1.6
+++ external/bsd/mdocml/dist/read.c	13 Oct 2012 13:19:12 -0000
@@ -94,6 +94,7 @@ static	const char * const	mandocerrs[MAN
 	"no title in document",
 	"document title should be all caps",
 	"unknown manual section",
+	"unknown manual volume/arch",
 	"date missing, using today's date",
 	"cannot parse date, using it verbatim",
 	"prologue macros out of order",

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-16 22:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-13 13:23 warn about unknown volume/arch in .Dt macro arguments Nicolas Joly
2012-11-16 22:23 ` Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).