-# 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)
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) = @_;
# 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!) {