about summary refs log tree commit homepage
path: root/script/public-inbox-init
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-03 07:21:57 +0000
committerEric Wong <e@80x24.org>2019-10-05 06:53:57 +0000
commit0069d1b85c45fd757e401cd018099c69b3ba9f24 (patch)
treeb3b299629522297c97e3eee24edc2c76987c46ab /script/public-inbox-init
parent845d45f8b1c33a4b5fb559101ca53238b4dfc1aa (diff)
downloadpublic-inbox-0069d1b85c45fd757e401cd018099c69b3ba9f24.tar.gz
Since I intend to add support for --skip-artnum, disambiguating
the long option name makes sense.  We'll support --skip
indefinitely for compatibility.
Diffstat (limited to 'script/public-inbox-init')
-rwxr-xr-xscript/public-inbox-init15
1 files changed, 8 insertions, 7 deletions
diff --git a/script/public-inbox-init b/script/public-inbox-init
index 98aea4bf..39f2a067 100755
--- a/script/public-inbox-init
+++ b/script/public-inbox-init
@@ -20,10 +20,11 @@ sub x { system(@_) and die join(' ', @_). " failed: $?\n" }
 sub usage { print STDERR "Usage: $usage\n"; exit 1 }
 my $version = undef;
 my $indexlevel = undef;
-my $skip;
-my %opts = ( 'V|version=i' => \$version,
-             'L|indexlevel=s' => \$indexlevel,
-             'S|skip=i' => \$skip,
+my $skip_epoch;
+my %opts = (
+        'V|version=i' => \$version,
+        'L|indexlevel=s' => \$indexlevel,
+        'S|skip|skip-epoch=i' => \$skip_epoch,
 );
 GetOptions(%opts) or usage();
 PublicInbox::Admin::indexlevel_ok_or_die($indexlevel) if defined $indexlevel;
@@ -104,8 +105,8 @@ if (-f "$mainrepo/inbox.lock") {
 
 $version = 1 unless defined $version;
 
-if ($version == 1 && defined $skip) {
-        die "--skip is only supported for -V2 repos\n";
+if ($version == 1 && defined $skip_epoch) {
+        die "--skip-epoch is only supported for -V2 repos\n";
 }
 
 my $ibx = PublicInbox::Inbox->new({
@@ -117,7 +118,7 @@ my $ibx = PublicInbox::Inbox->new({
 });
 
 my $creat_opt = {};
-PublicInbox::InboxWritable->new($ibx, $creat_opt)->init_inbox(0, $skip);
+PublicInbox::InboxWritable->new($ibx, $creat_opt)->init_inbox(0, $skip_epoch);
 
 # needed for git prior to v2.1.0
 umask(0077) if defined $perm;