From 04115815acef798c4330a76df9c1cb3d3542c9f9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 15 Dec 2020 09:14:31 +0000 Subject: lei: refine help/option parsing, implement "init" There's a bunch of work in here as the foundations are being fleshed out. One of the UI/UX is to make it easy to keep built-in help and shell completions consistent --- lib/PublicInbox/LeiStore.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/LeiStore.pm') diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index 56f668b8..b5b49efb 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -22,7 +22,12 @@ use PublicInbox::LeiSearch; sub new { my (undef, $dir, $opt) = @_; my $eidx = PublicInbox::ExtSearchIdx->new($dir, $opt); - bless { priv_eidx => $eidx }, __PACKAGE__; + my $self = bless { priv_eidx => $eidx }, __PACKAGE__; + if ($opt->{creat}) { + PublicInbox::SearchIdx::load_xapian_writable(); + eidx_init($self); + } + $self; } sub git { $_[0]->{priv_eidx}->git } # read-only -- cgit v1.2.3-24-ge0c7