1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/usr/bin/perl -w
# This is a small script which modifies the outputted txt docs into a more
# readable one, by adding some lines to the output.
use strict;
my $cacheword;
while (<>) {
if ($_ =~ /^(\w+)$/ && $_ !~ /^Name$/) {
$cacheword = $1;
}
if ($_ =~ /^Name$/) {
print "-----------------------\n$cacheword option\n-----------------------\n";
} elsif ($_ =~ /^Description$/) {
print "Description\n-----------\n";
} elsif ($_ =~ /^Synopsis$/) {
print "Synopsis\n--------\n";
} else {
print $_;
}
}
|