]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import_vger_from_mbox: add --filter parameter
authorEric Wong <e@yhbt.net>
Mon, 24 Feb 2020 00:17:24 +0000 (18:17 -0600)
committerEric Wong <e@yhbt.net>
Mon, 24 Feb 2020 18:30:06 +0000 (18:30 +0000)
It shouldn't be hard to make this into a more generic
importer not specific to vger lists.

scripts/import_vger_from_mbox

index b3aceb6becca87c4ead65287279cd0298254f32b..d1ce723162e47686647cd26a690a9df60e4c9933 100644 (file)
@@ -9,10 +9,12 @@ my $usage = "usage: $0 NAME EMAIL DIR <MBOX\n";
 my $dry_run;
 my $version = 2;
 my $variant = 'mboxrd';
+my $filter = 'PublicInbox::Filter::Vger';
 my %opts = (
        'n|dry-run' => \$dry_run,
        'V|version=i' => \$version,
        'F|format=s' => \$variant,
+       'filter=s' => \$filter,
 );
 GetOptions(%opts) or die $usage;
 if ($variant ne 'mboxrd' && $variant ne 'mboxo') {
@@ -26,7 +28,7 @@ my $ibx = {
        name => $name,
        version => $version,
        address => [ $email ],
-       filter => 'PublicInbox::Filter::Vger',
+       filter => $filter,
 };
 $ibx = PublicInbox::Inbox->new($ibx);
 unless ($dry_run) {