man page xref: verify page title

Issue #15923 should have never happened: the problem should've
been autodetected. Make it so henceforth (and fix another
existing discrepancy)

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2022-09-26 06:14:58 -06:00
parent 1d6147fa13
commit fde4d21be5
2 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,4 @@
% podman-machine-ls 1
% podman-machine-list 1
## NAME
podman\-machine\-list - List virtual machines

View File

@ -292,6 +292,15 @@ sub podman_man {
chomp $line;
next unless $line; # skip empty lines
# First line (page title) must match the command name.
if ($line =~ /^%\s+/) {
my $expect = "% $command 1";
if ($line ne $expect) {
warn "$ME: $subpath:$.: wrong title line '$line'; should be '$expect'\n";
++$Errs;
}
}
# .md files designate sections with leading double hash
if ($line =~ /^##\s*(GLOBAL\s+)?OPTIONS/) {
$section = 'flags';