]> Sergey Matveev's repositories - public-inbox.git/commitdiff
public-inbox-index: exit with usage if not given an arg
authorEric Wong <e@80x24.org>
Tue, 18 Aug 2015 03:17:16 +0000 (03:17 +0000)
committerEric Wong <e@80x24.org>
Tue, 18 Aug 2015 03:17:43 +0000 (03:17 +0000)
I often forget how to use this myself :x

public-inbox-index

index 2fcf5627d3fc7a59d8f117e11a57bab0874b0db3..1104bbc8238eeaac4599300afa3e7825c91f837b 100755 (executable)
@@ -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) = @_;