From f97f6e1472b113eea82c5eef16179de887f33c4a Mon Sep 17 00:00:00 2001 From: teastep Date: Mon, 11 Jun 2007 18:32:47 +0000 Subject: [PATCH] Check compiler.pl's arguments a bit closer git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6516 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/compiler.pl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Shorewall-perl/compiler.pl b/Shorewall-perl/compiler.pl index c011b9968..68d017668 100755 --- a/Shorewall-perl/compiler.pl +++ b/Shorewall-perl/compiler.pl @@ -25,19 +25,18 @@ # use strict; use lib '/usr/share/shorewall-perl'; -use Shorewall::Common qw( $verbose $timestamp ); -use Shorewall::Config qw( fatal_error $shorewall_dir ); -use Shorewall::Compiler qw( compiler $export ); +use Shorewall::Common qw/ $verbose $timestamp /; +use Shorewall::Config qw/ fatal_error $shorewall_dir /; +use Shorewall::Compiler qw/ compiler $export /; use Getopt::Long; -# -# Compile/Check the configuration. -# sub usage() { print STDERR "usage: compiler.pl [ --export ] [ --directory ] [ --verbose {0-2} ] [ --timestamp ] [ ]\n"; exit 1; } +Getopt::Long::Configure ('bundling'); + my $result = GetOptions('export' => \$export, 'directory=s' => \$shorewall_dir, 'verbose=i' => \$verbose, @@ -49,4 +48,6 @@ if ( $shorewall_dir ne '' ) { fatal_error "$shorewall_dir is not an existing directory" unless -d $shorewall_dir; } +usage unless @ARGV < 2; + compiler $ARGV[0];