]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-index
support -C (chdir) for most non-daemon commands
[public-inbox.git] / script / public-inbox-index
index 0034d44cbd36b69cbe16d9c3dd344b6bcb245d84..ca190a2e32d03fed0bb4200903a771cedb645bd7 100755 (executable)
@@ -42,7 +42,7 @@ GetOptions($opt, qw(verbose|v+ reindex rethread compact|c+ jobs|j=i prune
                batch_size|batch-size=s
                sequential-shard|seq-shard
                no-update-extindex update-extindex|E=s@
-               fast-noop|F skip-docdata all help|h))
+               fast-noop|F skip-docdata all C=s@ help|h))
        or die $help;
 if ($opt->{help}) { print $help; exit 0 };
 die "--jobs must be >= 0\n" if defined $opt->{jobs} && $opt->{jobs} < 0;
@@ -56,6 +56,7 @@ if ($opt->{reindex} && delete($opt->{'fast-noop'})) {
 # require lazily to speed up --help
 require PublicInbox::Admin;
 PublicInbox::Admin::require_or_die('-index');
+PublicInbox::Admin::do_chdir(delete $opt->{C});
 
 my $cfg = PublicInbox::Config->new; # Config is loaded by Admin
 $opt->{-use_cwd} = 1;