--- mirror_cpan.pl 2003/08/06 17:55:19 1.3 +++ mirror_cpan.pl 2003/09/04 14:39:17 1.4 @@ -26,8 +26,6 @@ my $LOCAL = "/rest/cpan/CPAN/"; my $TRACE = 0; -$TRACE = 1 if grep(/-v/,@ARGV); -$TRACE = 1 if grep(/-d/,@ARGV); ### END CONFIG @@ -36,6 +34,7 @@ use File::Basename qw(dirname); use File::Spec::Functions qw(catfile devnull); use File::Find qw(find); +use Getopt::Long; ## LWP - use URI (); @@ -47,6 +46,16 @@ ## Archive::Tar - use Archive::Tar qw(); +## process command-line arguments +my $result = GetOptions( + "local=s" => \$LOCAL, + "remote=s" => \$REMOTE, + "verbose!" => \$TRACE, + "debug!" => \$TRACE + ); + +print "local path: $LOCAL\nremote URI: $REMOTE\n" if ($TRACE); + ## first, get index files my_mirror($_) for qw( authors/01mailrc.txt.gz