File: fix_help.pl

package info (click to toggle)
moxftp 2.2-18.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,160 kB
  • ctags: 3,837
  • sloc: ansic: 43,420; makefile: 353; perl: 262; sh: 192
file content (30 lines) | stat: -rwxr-xr-x 528 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
system "nroff -man help.man >help.out";

open(input,"help.out");
open(output,">help");

sub do_blanks {
   foreach $item (@blanks) {
	print output "$SEP$item";
   }
   undef(@blanks);
}
while (<input>) {
    chop;
    if (/^!/) { 
        do do_blanks();	
	print output "$_\n" ; 
	$SEP = "";
    } elsif (/^\*/) { 
        do do_blanks();	
	print output "\n$_\\\n"; 
	$SEP = "";
    } elsif (/^$/) {
	push(@blanks, $_);
    } else {
        do do_blanks();	
	print output "$SEP$_";
	$SEP = "\\n\\\n";
    }
}
print output "\n";