Remove stray use.
[perl-App-RetroPAN.git] / bin / retropan
blobdfe6821dfe2b51ad0881b7865f1154b2926542e5
1 #!/usr/bin/env perl
2 # vim:ts=4:shiftwidth=4:expandtab
4 use strict;
5 use warnings;
7 use Getopt::Long;
8 use Pod::Usage;
9 use DateTime;
10 use DateTime::Format::ISO8601;
11 use App::RetroPAN;
13 my $opt_man = 0;
14 my $opt_help = 0;
15 my $opt_dir = "minicpan/";
16 my $opt_version;
17 my $opt_before = DateTime->now->iso8601;
19 GetOptions(
20 'help|?' => \$opt_help,
21 man => \$opt_man,
22 "dir=s" => \$opt_dir,
23 "before=s" => \$opt_before,
24 version => \$opt_version,
25 ) or pod2usage(2);
26 pod2usage(1) if $opt_help;
27 pod2usage(-exitval => 0, -verbose => 2) if $opt_man;
29 if ($opt_version) {
30 print STDERR "Version $App::RetroPAN::VERSION\n";
31 exit 0;
34 die "No time specified" if !$opt_before;
36 my $dt = DateTime::Format::ISO8601->parse_datetime($opt_before);
38 print STDERR "No modules to find\n" if !@ARGV;
40 my ($dists_required, $dist_to_url) = App::RetroPAN::find_deps_on_date($dt->iso8601, @ARGV);
42 print join(", ", @{ $dists_required })."\n";
44 App::RetroPAN::make_minicpan($opt_dir, $dists_required, $dist_to_url);
46 exit 0;
48 =head1 NAME
50 retropan - Makes a historic minicpan E<9203>
52 =head1 SYNOPSIS
54 $ retropan --dir minicpan/ --before 2011-02-01T00:00:00 Moose Catalyst
56 =head1 OPTIONS
58 The trailing arguments are the module names to be looked up.
60 =over
62 =item B<--before>
64 Search for distributions released before this data. Defaults to now.
67 =item B<--minicpan>
69 Path of where to place our minicpan. Defaults to C<minicpan/>.
71 =back
73 =head1 SEE ALSO
75 L<App::RetroPAN>
77 =head1 LICENSE
79 This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
81 =head1 AUTHOR
83 Dave Lambley <dlambley@cpan.org>
85 =cut