about summary refs log tree commit homepage
path: root/script/public-inbox-init
diff options
authorEric Wong <e@80x24.org>2020-09-01 01:15:01 +0000
committerEric Wong <e@80x24.org>2020-09-02 08:53:55 +0000
commit16870b42ac68a8704467989cb20c2c571e4749ab (patch)
treeabc78c7ad8e939044909f66a64e8c2fb5fa1cd58 /script/public-inbox-init
parent6accd690b16aa0bce7117286944d69f378611eb8 (diff)
`-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".
Diffstat (limited to 'script/public-inbox-init')
1 files changed, 3 insertions, 4 deletions
diff --git a/script/public-inbox-init b/script/public-inbox-init
index 037e8e56..ae4a575c 100755
--- a/script/public-inbox-init
+++ b/script/public-inbox-init
@@ -5,9 +5,8 @@ use strict;
 use v5.10.1;
 use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
 use Fcntl qw(:DEFAULT);
-my $usage = 'public-inbox-init NAME INBOX_DIR HTTP_URL ADDRESS [ADDRESS..]';
 my $help = <<EOF; # the following should fit w/o scrolling in 80x24 term:
-usage: $usage
+usage: public-inbox-init NAME INBOX_DIR HTTP_URL ADDRESS [ADDRESS..]
   Initialize a public-inbox
@@ -44,10 +43,10 @@ my %opts = (
         'j|jobs=i' => \$jobs,
         'ng|newsgroup=s' => \$ng,
         'skip-docdata' => \$skip_docdata,
-        'help|?' => \$show_help,
+        'help|h' => \$show_help,
 my $usage_cb = sub {
-        print STDERR "Usage: $usage\n";
+        print STDERR $help;
         exit 1;
 GetOptions(%opts) or $usage_cb->();