#!/usr/bin/perl
#
-# $OpenBSD: mdoclint,v 1.72 2017/06/23 19:56:57 schwarze Exp $
+# $OpenBSD: mdoclint,v 1.73 2017/06/24 16:10:01 schwarze Exp $
# $NetBSD: mdoclint,v 1.77 2017/06/08 10:19:56 wiz Exp $
#
# Copyright (c) 2001-2017 Thomas Klausner
};
use vars qw(
- $opt_D $opt_F $opt_h
- $opt_m $opt_o $opt_p $opt_S $opt_v $opt_w $opt_x
+ $opt_D $opt_F $opt_h $opt_m $opt_p $opt_S $opt_v $opt_w $opt_x
);
my $arch=`uname -m`;
chomp($arch);
-my $options="DFhmopSvwx";
+my $options="DFhmpSvwx";
sub usage
{
-F fix whitespace problems (asks before overwriting)
-h display this help text
-m warn about man pages that are not in mdoc(7) format
- -o warn about non-empty .Os strings
-p warn about punctuation problems
-S warn about any .Sh weirdness
-v verbose output
-w show section header in warnings
-x warn about cross-references with missing targets
-Default is -DmopSx if no flag is specified.
+Default is -DmpSx if no flag is specified.
EOF
exit(0);
}
$opt_h and usage();
# default to all warnings if no flag is set
- unless ($opt_D or $opt_m or $opt_o or $opt_p or $opt_S or $opt_x) {
- $opt_D = $opt_m = $opt_o = $opt_p = $opt_S = $opt_x = 1;
+ unless ($opt_D or $opt_m or $opt_p or $opt_S or $opt_x) {
+ $opt_D = $opt_m = $opt_p = $opt_S = $opt_x = 1;
}
}
$s->{names}{$1.$s->{sec}} = 1;
}
}
- if (/^\.Os\s+(.+)/o) {
- $s->warning(".Os used with argument `$1'") if $opt_o;
- }
if (/^\./o and /Ns [\.();,\[\]\{\}:]/o) {
$s->warning("possible Ns abuse: `$_'") if $opt_p;
}
-.\" $OpenBSD: mdoclint.1,v 1.29 2017/06/23 19:16:49 schwarze Exp $
+.\" $OpenBSD: mdoclint.1,v 1.30 2017/06/24 16:10:01 schwarze Exp $
.\" $NetBSD: mdoclint.1,v 1.23 2017/06/08 10:19:56 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 23 2017 $
+.Dd $Mdocdate: June 24 2017 $
.Dt MDOCLINT 1
.Os
.Sh NAME
.Nd man page verifier
.Sh SYNOPSIS
.Nm
-.Op Fl DFhmopSvwx
+.Op Fl DFhmpSvwx
.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 DmopSx
+.Fl DmpSx
is assumed (that is, everything except
.Fl Fhvw ) .
.Pp
Warn if man page is not in
.Xr mdoc 7
format.
-.It Fl o
-Warn when the .Os macro has an argument (it shouldn't have one at
-least in the base system, because on
-.Ox
-the current version is default).
.It Fl p
Warn about abuse of .Ns to get punctuation directly next to a word.
.It Fl S
.Aq Mt schwarze@OpenBSD.org
.Sh BUGS
The
-.Fl o
-and
.Fl p
-flags currently produce too many bogus warnings.
+flag currently produce too many bogus warnings.
.Pp
The
.Fl x