fix catchup and uncatchup commands so that they accept ranges
[spider.git] / cmd / uncatchup.pl
index 4f7808d728f322f957e732af3ef24d1ba39f2643..4046107141c2e6a6e225eb9be7f0fbb341972d7e 100644 (file)
@@ -28,13 +28,19 @@ foreach my $msgno (@f) {
        if ($msgno =~ /^al/oi) {
                @ref = DXMsg::get_all();
                last;
+       } elsif (my ($f, $t) = $msgno =~ /(\d+)-(\d+)/) {
+               while ($f < $t) {
+                       $ref = DXMsg::get($f++);
+                       push @ref, $ref if $ref;
+               }
+       } else {
+               $ref = DXMsg::get($msgno);
+               unless ($ref) {
+                       push @out, $self->msg('m13', $msgno);
+                       next;
+               }
+               push @ref, $ref;
        }
-       $ref = DXMsg::get($msgno);
-       unless ($ref) {
-               push @out, $self->msg('m13', $msgno);
-               next;
-       }
-       push @ref, $ref;
 }
 
 foreach $ref (@ref) {