From: Eric Wong <e@80x24.org>
Date: Tue, 18 Aug 2015 03:17:16 +0000 (+0000)
Subject: public-inbox-index: exit with usage if not given an arg
X-Git-Tag: v1.0.0~1043
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=db461727220a3d6724bfb5b9e60f4a4401699d0d;p=public-inbox.git

public-inbox-index: exit with usage if not given an arg

I often forget how to use this myself :x
---

diff --git a/public-inbox-index b/public-inbox-index
index 2fcf5627..1104bbc8 100755
--- a/public-inbox-index
+++ b/public-inbox-index
@@ -17,11 +17,11 @@ if ($@) {
 }
 
 sub usage { print STDERR "Usage: $usage\n"; exit 1 }
-if (@ARGV) {
-	foreach my $dir (@ARGV) {
-		index_dir($dir);
-	}
-};
+usage() unless @ARGV;
+
+foreach my $dir (@ARGV) {
+	index_dir($dir);
+}
 
 sub index_dir {
 	my ($git_dir) = @_;