9 GetOptions("basedir=s" => \$basedir)
10 or die("Cannot parse command line arguments\n");
15 my ($where, $what, $error) = @_;
16 print "$where: $error: $what\n";
22 open my $fh, "<", "$basedir/$page.txt";
23 my $firstline = <$fh>;
26 my ($section) = ($firstline =~ /.*\((\d)\)$/);
32 open my $fh, "<", $file
35 my $where = "$file:$.";
36 while (s/linkgit:((.*?)\[(\d)\])//) {
37 my ($target, $page, $section) = ($1, $2, $3);
40 $page =~ s/{litdd}/--/g;
42 if ($page !~ /^git/) {
43 report($where, $target, "nongit link");
46 if (! -f "$basedir/$page.txt") {
47 report($where, $target, "no such source");
50 my $real_section = grab_section($page);
51 if ($real_section != $section) {
52 report($where, $target,
53 "wrong section (should be $real_section)");
62 lint($File::Find::name) if -f && /\.txt$/;
66 find({ wanted => \&lint_it, no_chdir => 1 }, $basedir);