Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753714Ab2HaNSe (ORCPT ); Fri, 31 Aug 2012 09:18:34 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:62059 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753662Ab2HaNSc (ORCPT ); Fri, 31 Aug 2012 09:18:32 -0400 From: Cruz Julian Bishop To: mcgrof@gmail.com Cc: linux-kernel@vger.kernel.org, Cruz Julian Bishop Subject: [PATCH 3/4] scripts/checkincludes.pl: Fix a bug introduced in the last commit Date: Fri, 31 Aug 2012 23:18:09 +1000 Message-Id: <1346419090-3808-4-git-send-email-cruzjbishop@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346419090-3808-1-git-send-email-cruzjbishop@gmail.com> References: <1346419090-3808-1-git-send-email-cruzjbishop@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1222 Lines: 50 Since the previous commit, simply specifying -r without any files caused no message to be displayed. Before said commit, the usage() function was called. This commit simply calls the usage() function if no files were specified - This includes once other arguments are supported. Signed-off-by: Cruz Julian Bishop --- scripts/checkincludes.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/checkincludes.pl b/scripts/checkincludes.pl index 7d713c2..cde7ce1 100755 --- a/scripts/checkincludes.pl +++ b/scripts/checkincludes.pl @@ -30,12 +30,16 @@ if ($#ARGV < 0) { usage(); } +my $argc = 0; + foreach my $arg (@ARGV) { if ($arg eq "-r") { $remove = 1; } else { open(my $f, '<', $arg) or die "Cannot open $arg: $!.\n"; + + $argc++; my %includedfiles = (); my @file_lines = (); @@ -84,3 +88,7 @@ foreach my $arg (@ARGV) { close($f); } } + +if ($argc == 0) { + usage(); +} -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/