From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0FF2D1F81B for ; Tue, 18 Aug 2015 03:17:17 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] public-inbox-index: exit with usage if not given an arg Date: Tue, 18 Aug 2015 03:17:16 +0000 Message-Id: <1439867837-3497-1-git-send-email-e@80x24.org> List-Id: I often forget how to use this myself :x --- public-inbox-index | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public-inbox-index b/public-inbox-index index 2fcf562..1104bbc 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) = @_; -- EW