2 # Copyright (C) 2018-2019 all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
6 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
7 use PublicInbox::InboxWritable;
8 use PublicInbox::Xapcmd;
9 use PublicInbox::Admin;
10 PublicInbox::Admin::require_or_die('-index');
11 my $usage = "Usage: public-inbox-compact INBOX_DIR\n";
12 my $opt = { compact => 1, -coarse_lock => 1 };
13 GetOptions($opt, @PublicInbox::Xapcmd::COMPACT_OPT) or
14 die "bad command-line args\n$usage";
15 my @ibxs = PublicInbox::Admin::resolve_inboxes(\@ARGV) or die $usage;
17 my $ibx = PublicInbox::InboxWritable->new($_);
18 PublicInbox::Xapcmd::run($ibx, 'compact', $opt);