From 16870b42ac68a8704467989cb20c2c571e4749ab Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 1 Sep 2020 01:15:01 +0000 Subject: script/*: fold $usage into $help, support `-h' instead of -? `-h' doesn't conflict with anything, and some users (including git users) may be more accustomed to using it rather than the rarely-seen-outside-of-Getopt::Long `-?' switch. We can also rely on the GetOptions() function to emit a proper error message instead of just "bad command-line args". --- script/public-inbox-xcpdb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'script/public-inbox-xcpdb') diff --git a/script/public-inbox-xcpdb b/script/public-inbox-xcpdb index 2bfadc09..84620175 100755 --- a/script/public-inbox-xcpdb +++ b/script/public-inbox-xcpdb @@ -4,9 +4,8 @@ use strict; use v5.10.1; use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev); -my $usage = 'Usage: public-inbox-xcpdb [options] INBOX_DIR'; my $help = <{help}) { print $help; exit 0 }; use PublicInbox::Admin; @@ -44,7 +42,7 @@ PublicInbox::Admin::require_or_die('-search'); require PublicInbox::Config; my $cfg = PublicInbox::Config->new; my @ibxs = PublicInbox::Admin::resolve_inboxes(\@ARGV, $opt, $cfg) or - die $usage; + die $help; my $idx_env = PublicInbox::Admin::index_prepare($opt, $cfg); # we only set XAPIAN_FLUSH_THRESHOLD for index, since cpdb doesn't -- cgit v1.2.3-24-ge0c7