#!/usr/bin/perl # # From an AFS Administrative Reference HTML page, try to figure out what # command or file it corresponds to and output the appropriate generate-pod # command. Intended to be run as follows: # # generate-file-map *.htm > generate-pods.sh # # Each line of the output will be a generate-pod invocation, saving its output # to the appropriate POD file. my %except = map { $_ => 1 } ('Table of Contents', 'Audience and Purpose', 'Organization', 'How to Use This Document', 'Related Documents', 'Typographical Conventions'); for my $file (@ARGV) { my $command; open (IN, '<', $file) or die "$0: cannot open $file: $!\n"; while () { s///g; s%%%g; if (/

]+>([^<]+)/) { $command = $1; last; } } if ($command) { next if $except{$command}; next if $command =~ /\(AFS version\)/; $command =~ s/,.*//; $command =~ s/ and.*//; $command =~ s/\s/_/g; $command =~ s/([\(\)])/\\$1/g; print "../../man-pages/generate-pod $file >" ." ../../man-pages/pod/$command.pod\n"; } }