about summary refs log tree commit homepage
path: root/script
diff options
authorEric Wong <e@80x24.org>2019-11-15 09:50:35 +0000
committerEric Wong <e@80x24.org>2019-11-16 11:05:23 +0000
commitd155f989769861be45938345350f07365ca945c1 (patch)
tree9837aca73c26c3189965dbafddf376c15dd62c0f /script
parent321defd4c722ae897fc99e10ce8d05515a97e91f (diff)
Avoid 'Variable "%s" will not stay shared' warnings
when the contents of this script eval'ed into a sub.
Diffstat (limited to 'script')
1 files changed, 1 insertions, 2 deletions
diff --git a/script/public-inbox-index b/script/public-inbox-index
index 139b6e56..102381c3 100755
--- a/script/public-inbox-index
+++ b/script/public-inbox-index
@@ -18,11 +18,10 @@ GetOptions($opt, qw(verbose|v+ reindex jobs|j=i prune indexlevel|L=s))
         or die "bad command-line args\n$usage";
 die "--jobs must be positive\n" if defined $opt->{jobs} && $opt->{jobs} <= 0;
-sub usage { print STDERR "Usage: $usage\n"; exit 1 }
 my @ibxs = PublicInbox::Admin::resolve_inboxes(\@ARGV);
-usage() unless @ibxs;
+unless (@ibxs) { print STDERR "Usage: $usage\n"; exit 1 }
 my $mods = {};
 foreach my $ibx (@ibxs) {
         # XXX: users can shoot themselves in the foot, with opt->{indexlevel}