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
This commit is contained in:
teastep 2007-06-11 18:32:47 +00:00
parent 910252279f
commit f97f6e1472

View File

@ -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 <directory> ] [ --verbose {0-2} ] [ --timestamp ] [ <filename> ]\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];