Documentation / cat-texi.perlon commit t3703, t4208: add test cases for magic pathspec (6fd09f5)
   1#!/usr/bin/perl -w
   2
   3my @menu = ();
   4my $output = $ARGV[0];
   5
   6open TMP, '>', "$output.tmp";
   7
   8while (<STDIN>) {
   9        next if (/^\\input texinfo/../\@node Top/);
  10        next if (/^\@bye/ || /^\.ft/);
  11        if (s/^\@top (.*)/\@node $1,,,Top/) {
  12                push @menu, $1;
  13        }
  14        s/\(\@pxref{\[(URLS|REMOTES)\]}\)//;
  15        print TMP;
  16}
  17close TMP;
  18
  19printf '\input texinfo
  20@setfilename gitman.info
  21@documentencoding UTF-8
  22@dircategory Development
  23@direntry
  24* Git Man Pages: (gitman).  Manual pages for Git revision control system
  25@end direntry
  26@node Top,,, (dir)
  27@top Git Manual Pages
  28@documentlanguage en
  29@menu
  30', $menu[0];
  31
  32for (@menu) {
  33        print "* ${_}::\n";
  34}
  35print "\@end menu\n";
  36open TMP, '<', "$output.tmp";
  37while (<TMP>) {
  38        print;
  39}
  40close TMP;
  41print "\@bye\n";
  42unlink "$output.tmp";