forked from gugod/App-perlbrew
/
generate-readme.pl
47 lines (38 loc) · 1.08 KB
/
generate-readme.pl
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
# -*- perl -*-
use strict;
use FindBin;
use Cwd qw(realpath);
use File::Spec::Functions;
use Pod::Usage;
my $perlbrew_pm = realpath catfile($FindBin::Bin, "..", "lib", "App", "perlbrew.pm");
my $perlbrew_pl = realpath catfile($FindBin::Bin, "..", "bin", "perlbrew");
my $readme = realpath catfile($FindBin::Bin, "..", "README");
my $out = "";
open my $fh, ">", \$out;
pod2usage(
-exitval => "NOEXIT",
-verbose => 99,
-sections => ["NAME", "DESCRIPTION", "INSTALLATION"],
-input => $perlbrew_pm,
-output => $fh,
-noperldoc => 1
);
pod2usage(
-exitval => "NOEXIT",
-verbose => 99,
-sections => ["CONFIGURATION"],
-input => $perlbrew_pl,
-output => $fh,
-noperldoc => 1
);
pod2usage(
-exitval => "NOEXIT",
-verbose => 99,
-sections => ["PROJECT DEVELOPMENT", "AUTHOR", "COPYRIGHT", "LICENSE", "DISCLAIMER OF WARRANTY"],
-input => $perlbrew_pm,
-output => $fh,
-noperldoc => 1
);
open(my $readme_fh, ">", $readme) or die "Failed to open $readme";
print $readme_fh $out;
print "Done.\n";