add aliases for bump-version alpha option
[p5sagit/Distar.git] / lib / Distar / helpers / generate-license
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4
5 use Software::LicenseUtils;
6 use Getopt::Long qw(:config gnu_getopt);
7
8 GetOptions(
9   "o|output=s"    => \(my $output = '-'),
10 ) or die("Error in command line arguments!\n");
11
12 my ($authors, @licenses) = @ARGV;
13
14 my $out;
15 if ($output eq '-') {
16   $out = \*STDOUT;
17 }
18 else {
19   open $out, '>', $output
20     or die "Unable to write to $output: $!\n";
21 }
22
23 my %uniq;
24 print { $out }
25   join "\n\n",
26   map { $_->new({holder => $authors})->license }
27   grep { !$uniq{$_}++ }
28   map { Software::LicenseUtils->guess_license_from_meta_key($_, 2) }
29   @licenses;