ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/pod/genhelp.pl
(Generate patch)

Comparing deliantra/server/pod/genhelp.pl (file contents):
Revision 1.1 by pippijn, Fri Sep 8 01:54:26 2006 UTC vs.
Revision 1.2 by pippijn, Fri Sep 8 03:08:21 2006 UTC

1#!/usr/bin/perl 1#!/usr/bin/perl
2 2
3# $Id: genhelp.pl,v 1.1 2006/09/08 01:54:26 pippijn Exp $ 3# $Id: genhelp.pl,v 1.2 2006/09/08 03:08:21 pippijn Exp $
4 4
5use strict; 5use strict;
6use warnings; 6use warnings;
7use Pod::POM; 7use Pod::POM;
8use Pod::POM::View::Text; 8use Pod::POM::View::Text;
9 9
10my $pom = Pod::POM->new(); 10my $pom = Pod::POM->new();
11my $pod = $pom->parse_file($ARGV[0]); 11my $pod = $pom->parse_file($ARGV[0]);
12 12
13foreach my $head1 (grep { /Listing/ } $pod->head1()) { 13foreach my $head1 (grep { /Command/ } $pod->head1()) {
14 my $i = 0; 14 my $i = 0;
15 my @command; 15 my @command;
16 foreach my $head2 ($head1->head2) { 16 foreach my $head2 ($head1->head2) {
17 ($command[$i], undef) = split ' ', $head2->title; 17 ($command[$i], undef) = split ' ', $head2->title;
18 if ($command[$i] =~ /^X</) { 18 if ($command[$i] =~ /^X</) {
19 (undef, $command[$i]) = split '>', $command[$i]; 19 (undef, $command[$i]) = split '>', $command[$i];
20 } 20 }
21 open (HELP, ">help/".$command[$i]); 21 open (HELP, ">".$ARGV[1]."/".$command[$i]);
22 my $content = $head2->present('Pod::POM::View::Text'); 22 my $content = $head2->present('Pod::POM::View::Text');
23 print HELP $content; 23 print HELP $content;
24 close HELP; 24 close HELP;
25 $i++; 25 $i++;
26 } 26 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines