]> andersk Git - libfaim.git/blob - utils/docs/split-man.pl
- Fri Nov 10 08:24:34 UTC 2000
[libfaim.git] / utils / docs / split-man.pl
1 #!/usr/bin/perl
2
3 if ($#ARGV < 0) {
4    die "where do I put the results?\n";
5 }
6
7 mkdir $ARGV[0],0777 or die "Can't create $ARGV[0]: $!\n";
8 $state = 0;
9 while (<STDIN>) {
10     if (/^\.TH \"[^\"]*\" 3 \"([^\"]*)\"/) {
11         if ($state == 1) { close OUT }
12         $state = 1;
13         $fn = "$ARGV[0]/$1.3";
14         print STDERR "Creating $fn\n";
15         open OUT, ">$fn" or die "can't open $fn: $!\n";
16         print OUT $_;
17     } elsif ($state != 0) {
18         print OUT $_;
19     }
20 }
21
22 close OUT;
23
This page took 0.275638 seconds and 5 git commands to generate.