]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-convert
convert: fix --no-index switch
[public-inbox.git] / script / public-inbox-convert
index acecf3d54ed5db44b5aa585fe4e939a8f52e5aac..68b0b31a41ff57b4371517b5efb62af6b4794c05 100755 (executable)
@@ -19,8 +19,8 @@ my %opts = (
        '--index!' => \$index,
 );
 GetOptions(%opts) or die "bad command-line args\n$usage";
-my $old_dir = shift or die $usage;
-my $new_dir = shift or die $usage;
+my $old_dir = shift(@ARGV) or die $usage;
+my $new_dir = shift(@ARGV) or die $usage;
 die "$new_dir exists\n" if -d $new_dir;
 die "$old_dir not a directory\n" unless -d $old_dir;
 my $config = eval { PublicInbox::Config->new };
@@ -151,7 +151,5 @@ if (my $mm = $old->mm) {
        chop(my $cmt = $epoch0->qx(qw(rev-parse --verify), $head));
        $v2w->last_epoch_commit(0, $cmt);
 }
-if ($index) {
-       $v2w->index_sync({reindex => 1});
-       $v2w->done;
-}
+$v2w->index_sync({reindex => 1}) if $index;
+$v2w->done;