]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/AdminEdit.pm
imap+nntp: share COMPRESS implementation
[public-inbox.git] / lib / PublicInbox / AdminEdit.pm
index d4a92266d95a5d01f3fa6b4c90ddc0c26a86c7f0..c8c3d3e8aeb44aae4c1202c273465fe9100d3267 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # common stuff between -edit, -purge (and maybe -learn in the future)
@@ -6,7 +6,7 @@ package PublicInbox::AdminEdit;
 use strict;
 use warnings;
 use PublicInbox::Admin;
-our @OPT = qw(all force|f verbose|v!);
+our @OPT = qw(all force|f verbose|v! help|h);
 
 sub check_editable ($) {
        my ($ibxs) = @_;
@@ -27,8 +27,9 @@ sub check_editable ($) {
                # Make sure it's purged in that case:
                $ibx->over or die "no over.sqlite3 in $ibx->{inboxdir}\n";
 
-               # $ibx->{search} is populated by $ibx->over call
-               my $xdir_ro = $ibx->{search}->xdir(1);
+               require PublicInbox::Search;
+               my $xdir_ro = PublicInbox::Search->new($ibx)->xdir(1);
+
                my $nshard = 0;
                foreach my $shard (<$xdir_ro/*>) {
                        if (-d $shard && $shard =~ m!/[0-9]+\z!) {