-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmkmanfile
executable file
·59 lines (49 loc) · 1.15 KB
/
mkmanfile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/perl -w
use strict;
if ( $#ARGV == 0 )
{
if ( $ARGV[ 0 ] =~ /eg-(.+)/ )
{
my $version = $1;
my $date = localtime();
open( TEMPLATE, "eg.man.1" ) || die "eg.man.1: $!\n";
open( TARGET, ">eg.1" ) || die "eg.1: $!\n";
while ( <TEMPLATE> )
{
if ( /^\s*!MAN_BUGS!\s*$/ )
{
open( BUGS, "BUGS" ) || die "BUGS: $!\n";
while ( <BUGS> )
{
print TARGET;
}
close( BUGS );
}
elsif ( /^\s*!MAN_TODO!\s*$/ )
{
open( TODO, "TODO" ) || die "TODO: $!\n";
while ( <TODO> )
{
print TARGET;
}
close( TODO );
}
else
{
s/!EG_VERSION!/$version/g;
s/!MAN_DATE!/$date/g;
print TARGET;
}
}
close( TARGET );
close( TEMPLATE );
}
else
{
die "\"dir\" in wrong format\n";
}
}
else
{
die "Need \"dir\" name...\n";
}