3 use File::Compare qw(compare);
6 my ($out, $nameattr) = @_;
7 my ($name, $attr) = @$nameattr;
8 my ($state, $description);
10 open I, '<', "$name.txt" or die "No such file $name.txt";
16 if ($state == 1 && /^----$/) {
20 next if ($state != 2);
26 if (!defined $description) {
27 die "No description found in $name.txt";
29 if (my ($verify_name, $text) = ($description =~ /^($name) - (.*)/)) {
30 print $out "linkgit:$name\[1\]::\n\t";
31 if ($attr =~ / deprecated /) {
32 print $out "(deprecated) ";
34 print $out "$text.\n\n";
37 die "Description does not match $name: $description";
46 my ($name, $cat, $attr) = /^(\S+)\s+(.*?)(?:\s+(.*))?$/;
47 $attr = '' unless defined $attr;
48 push @{$cmds{$cat}}, [$name, " $attr "];
51 for my $cat (qw(ancillaryinterrogators
60 my $out = "cmds-$cat.txt";
61 open O, '>', "$out+" or die "Cannot open output file $out+";
62 for (@{$cmds{$cat}}) {
67 if (-f "$out" && compare("$out", "$out+") == 0) {
71 print STDERR "$out\n";
72 rename "$out+", "$out";