File: modifytxt.pl

package info (click to toggle)
pisg 0.80~preview2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 1,440 kB
  • sloc: perl: 7,802; xml: 3,141; makefile: 192; sed: 169; tcl: 33; awk: 15; sh: 4
file content (24 lines) | stat: -rwxr-xr-x 574 bytes parent folder | download | duplicates (2)
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 $_;
    }

}