#!/usr/bin/perl
#
-# $OpenBSD: mdoclint,v 1.65 2017/06/01 14:55:24 schwarze Exp $
+# $OpenBSD: mdoclint,v 1.66 2017/06/03 12:23:13 schwarze Exp $
# $NetBSD: mdoclint,v 1.74 2017/06/01 14:38:50 wiz Exp $
#
# Copyright (c) 2001-2017 Thomas Klausner
use vars qw(
$opt_D $opt_d $opt_e $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_m $opt_o $opt_p $opt_r $opt_S $opt_v $opt_w $opt_x
);
my $arch=`uname -m`;
chomp($arch);
-my $options="aDdeFfHhlmnoprSvwXx";
+my $options="DdeFhlmoprSvwx";
sub usage
{
- my $default = OPENBSD ? "-DdmnoprSx" : "-DdelmnoprSx";
+ my $default = OPENBSD ? "-DdmoprSx" : "-DdelmoprSx";
print STDERR <<"EOF";
mdoclint: verify man page correctness
-h display this help text
-l warn about unknown libraries
-m warn about man pages that are not in mdoc(7) format
- -n warn about .Nd's ending in '.'
-o warn about non-empty .Os strings
-p warn about punctuation problems
-r warn about missing RCS Id
$opt_h and usage();
# default to all warnings if no flag is set
- unless ($opt_D or $opt_d or $opt_e or $opt_l
- or $opt_m or $opt_n or $opt_o or $opt_p or $opt_r
- or $opt_S or $opt_x) {
+ unless ($opt_D or $opt_d or $opt_e or $opt_l or $opt_m
+ or $opt_o or $opt_p or $opt_r or $opt_S or $opt_x) {
$opt_D = $opt_d = $opt_m =
- $opt_n = $opt_o = $opt_p = $opt_r = $opt_S =
- $opt_x = 1;
+ $opt_o = $opt_p = $opt_r = $opt_S = $opt_x = 1;
$opt_e = $opt_l = 1 if NETBSD;
}
}
$s->warning(".Os used with argument `$1'") if $opt_o;
}
- if (/^\.Nd.*\.$/o) {
- $s->warning(".Nd ends with a dot: `$_'") if $opt_n;
- }
-
if (/(\w\w)\.\s+[A-Z]/o and not /^.%T/ and not $s->{inliteral}) {
if ("$1" ne "St") {
$s->warning("new sentence, new line: `$_'") if $opt_p;
-.\" $OpenBSD: mdoclint.1,v 1.23 2017/06/01 14:55:24 schwarze Exp $
+.\" $OpenBSD: mdoclint.1,v 1.24 2017/06/03 12:23:13 schwarze Exp $
.\" $NetBSD: mdoclint.1,v 1.20 2017/06/01 14:38:50 wiz Exp $
.\"
.\" Copyright (c) 2001-2013 Thomas Klausner
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 1 2017 $
+.Dd $Mdocdate: June 3 2017 $
.Dt MDOCLINT 1
.Os
.Sh NAME
.Nd man page verifier
.Sh SYNOPSIS
.Nm
-.Op Fl DdeFhlmnoprSvwx
+.Op Fl DdeFhlmoprSvwx
.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 DdmnoprSx
+.Fl DdmoprSx
is assumed (that is, everything except
.Fl eFhlvw ) .
.Pp
Warn if man page is not in
.Xr mdoc 7
format.
-.It Fl n
-Warn when the .Nd macro's argument ends in a dot, that is
-.Sq \&. .
.It Fl o
Warn when the .Os macro has an argument (it shouldn't have one at
least in the base system, because on