fix parameter parsing when pagespec is ommited, and year is present

master
Joey Hess 2010-04-15 18:51:35 -04:00
parent 50d08bc2ae
commit 579ee70e95
1 changed files with 4 additions and 1 deletions

View File

@ -15,7 +15,10 @@ GetOptions(
"force" => \$force, "force" => \$force,
) || usage(); ) || usage();
my $setup=shift || usage(); my $setup=shift || usage();
my $pagespec=shift; my $pagespec;
if (@ARGV && $ARGV[0] !~ /^\d+$/) {
$pagespec=shift;
}
my $startyear=shift || 1900+(localtime(time))[5]; my $startyear=shift || 1900+(localtime(time))[5];
my $endyear=shift || $startyear; my $endyear=shift || $startyear;