]> Sergey Matveev's repositories - public-inbox.git/commitdiff
index: require --reindex when using --xapian-only
authorEric Wong <e@yhbt.net>
Mon, 10 Aug 2020 02:11:52 +0000 (02:11 +0000)
committerEric Wong <e@yhbt.net>
Mon, 10 Aug 2020 05:50:59 +0000 (05:50 +0000)
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

index 73ca29537b4feae1d44e1f636d115ac00fdb2d9f..9e0907be554815c7fe5bd6b1703721781bfe93ab 100755 (executable)
@@ -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;