#!/usr/bin/perl
#
-# $OpenBSD: mdoclint,v 1.63 2017/05/15 17:24:48 schwarze Exp $
-# $NetBSD: mdoclint,v 1.71 2017/05/15 09:33:03 wiz Exp $
+# $OpenBSD: mdoclint,v 1.64 2017/05/31 15:35:22 schwarze Exp $
+# $NetBSD: mdoclint,v 1.72 2017/05/16 13:27:39 wiz Exp $
#
# Copyright (c) 2001-2017 Thomas Klausner
# All rights reserved.
use vars qw(
$opt_D $opt_d $opt_e $opt_F $opt_f $opt_h $opt_l
- $opt_m $opt_n $opt_o $opt_p $opt_r $opt_S $opt_v $opt_w
- $opt_X $opt_x
+ $opt_m $opt_n $opt_o $opt_p $opt_r $opt_S $opt_v $opt_w $opt_x
);
sub usage
{
- my $default = OPENBSD ? "-DdfmnoprSXx" : "-DdeflmnoprSXx";
+ my $default = OPENBSD ? "-DdfmnoprSx" : "-DdeflmnoprSx";
print STDERR <<"EOF";
mdoclint: verify man page correctness
-S warn about any .Sh weirdness
-v verbose output
-w show section header in warnings
- -X warn about explicit mentions of the *BSD system names
-x warn about cross-references with missing targets
Default is $default if no flag is specified.
EOF
}
-my %short = (
- "Free" => ".Fx",
- "Net" => ".Nx",
- "DragonFly" => ".Dx",
- "Open" => ".Ox"
-);
-
my %libraries = (
"libarchive" => 1,
"libarm" => 1,
# default to all warnings if no flag is set
unless ($opt_D or $opt_d or $opt_e or $opt_f or $opt_l
or $opt_m or $opt_n or $opt_o or $opt_p or $opt_r
- or $opt_S or $opt_X or $opt_x) {
+ or $opt_S or $opt_x) {
$opt_D = $opt_d = $opt_f = $opt_m =
$opt_n = $opt_o = $opt_p = $opt_r = $opt_S =
- $opt_X = $opt_x = 1;
+ $opt_x = 1;
$opt_e = $opt_l = 1 if NETBSD;
}
}
if (/^\.Fn.*,.+/o) {
$s->warning("possible .Fn misuse: `$_'") if $opt_f;
}
-
- if (/\b(Free|Net|DragonFly|Open)BSD\b/o
- and not /\b(?:www|ftp)\.(?:Free|Net|DragonFly|Open)BSD\.org\b/o
- and not /\bOpenBSD\::.*3p\b/o
- and not /\/pub\/OpenBSD\//o
- and not /\@(?:Free|Net|Open)BSD\.(?i:org)\b/o) {
- $s->warning("verbose mention of `$1BSD' instead of "
- . "`$short{$1}': `$_'") if $opt_X;
- }
- if (/^\./o and (/Bx (Open)/o or /Bx (Free)/o
- or /Bx (DragonFly)/o or /Bx (Net)/o)) {
- $s->warning("`.Bx $1' found -- use $short{$1} instead")
- if $opt_X;
- }
if (/^\.Lb\s+(\S+)/o) {
if (not $libraries{$1}) {
$s->warning("Unknown library `$1' used as Lb argument") if $opt_l;
-.\" $OpenBSD: mdoclint.1,v 1.21 2017/05/15 17:24:48 schwarze Exp $
-.\" $NetBSD: mdoclint.1,v 1.15 2017/05/02 13:59:10 wiz Exp $
+.\" $OpenBSD: mdoclint.1,v 1.22 2017/05/31 15:35:22 schwarze Exp $
+.\" $NetBSD: mdoclint.1,v 1.18 2017/05/16 13:27:39 wiz Exp $
.\"
.\" Copyright (c) 2001-2013 Thomas Klausner
.\" All rights reserved.
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: May 15 2017 $
+.Dd $Mdocdate: May 31 2017 $
.Dt MDOCLINT 1
.Os
.Sh NAME
.Nd man page verifier
.Sh SYNOPSIS
.Nm
-.Op Fl DdeFfhlmnoprSvwXx
+.Op Fl DdeFfhlmnoprSvwx
.Ar
.Sh DESCRIPTION
.Nm
It tries to automatically find as many common
errors that occur when writing man pages as possible.
If no flags are given,
-.Fl DdfmnoprSXx
+.Fl DdfmnoprSx
is assumed (that is, everything except
.Fl eFhlvw ) .
.Pp
Display the section name,
in addition to the relevant line number,
in warnings.
-.It Fl X
-Warn about explicit mentions of the words
-.Dq FreeBSD ,
-.Dq NetBSD ,
-.Dq DragonFlyBSD ,
-and
-.Dq OpenBSD ,
-which should be replaced by .Fx, .Nx, .Dx, and .Ox respectively.
-Also notices occurrences of
-.Dq \&.Bx Free ,
-.Dq \&.Bx Net ,
-.Dq \&.Bx DragonFly ,
-and
-.Dq \&.Bx Open ,
-for which the same applies.
.It Fl x
Warn about cross-references whose target is missing, cross-references
to itself, or plain bogus cross-references.
utility first appeared in
.Ox 4.5 .
.Sh AUTHORS
-.An Thomas Klausner Aq Mt wiz@netbsd.org
-.An Marc Espie Aq Mt espie@openbsd.org
+.An Thomas Klausner
+.Aq Mt wiz@NetBSD.org
+.An Marc Espie
+.Aq Mt espie@OpenBSD.org
+.An Ingo Schwarze
+.Aq Mt schwarze@OpenBSD.org
.Sh BUGS
The
.Fl o