reactos/rosapps/mc/src/gindex.pl
Steven Edwards e5c0c7185e Midnight Commander for Win32
svn path=/trunk/; revision=2456
2001-12-30 10:02:14 +00:00

27 lines
671 B
Perl

#!/usr/bin/perl
# Since we use a linear search trought the block and the license and
# the warranty are quite big, we leave them at the end of the help file,
# the index will be consulted quite frequently, so we put it at the beginning.
@help_file = <>;
foreach $line (@help_file){
if ($line =~ /\x4\[(.*)\]/ && $line !~ /\x4\[main\]/){
$nodes[$node_count++] = $1;
$line =~ s/(\x4\[) */$1/;
}
}
print "\x4[Contents]\nTopics:\n\n";
foreach $node (@nodes){
if (length $node){
$node =~ m/^( *)(.*)$/;
printf (" %s\x1 %s \x2%s\x3", $1, $2, $2);
}
print "\n";
}
#foreach $line (@help_file){
# $line =~ s/%NEW_NODE%/\004/g;
#}
print @help_file;