From 03d2ebbcde99903bd84d3fd0c2815edc28ee3acf Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 10 Aug 2020 02:11:52 +0000 Subject: [PATCH] index: require --reindex when using --xapian-only This to avoid user error of a currently undocumented switch; since --xapian-only always goes through the full history at the moment. --- script/public-inbox-index | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/public-inbox-index b/script/public-inbox-index index 73ca2953..9e0907be 100755 --- a/script/public-inbox-index +++ b/script/public-inbox-index @@ -42,6 +42,9 @@ GetOptions($opt, qw(verbose|v+ reindex rethread compact|c+ jobs|j=i prune or die "bad command-line args\n$usage"; if ($opt->{help}) { print $help; exit 0 }; die "--jobs must be >= 0\n" if defined $opt->{jobs} && $opt->{jobs} < 0; +if ($opt->{xapianonly} && !$opt->{reindex}) { + die "--xapian-only requires --reindex\n"; +} # require lazily to speed up --help require PublicInbox::Admin; -- 2.44.0