mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 09:47:51 +02:00
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:
parent
910252279f
commit
f97f6e1472
@ -25,19 +25,18 @@
|
|||||||
#
|
#
|
||||||
use strict;
|
use strict;
|
||||||
use lib '/usr/share/shorewall-perl';
|
use lib '/usr/share/shorewall-perl';
|
||||||
use Shorewall::Common qw( $verbose $timestamp );
|
use Shorewall::Common qw/ $verbose $timestamp /;
|
||||||
use Shorewall::Config qw( fatal_error $shorewall_dir );
|
use Shorewall::Config qw/ fatal_error $shorewall_dir /;
|
||||||
use Shorewall::Compiler qw( compiler $export );
|
use Shorewall::Compiler qw/ compiler $export /;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
#
|
|
||||||
# Compile/Check the configuration.
|
|
||||||
#
|
|
||||||
sub usage() {
|
sub usage() {
|
||||||
print STDERR "usage: compiler.pl [ --export ] [ --directory <directory> ] [ --verbose {0-2} ] [ --timestamp ] [ <filename> ]\n";
|
print STDERR "usage: compiler.pl [ --export ] [ --directory <directory> ] [ --verbose {0-2} ] [ --timestamp ] [ <filename> ]\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Getopt::Long::Configure ('bundling');
|
||||||
|
|
||||||
my $result = GetOptions('export' => \$export,
|
my $result = GetOptions('export' => \$export,
|
||||||
'directory=s' => \$shorewall_dir,
|
'directory=s' => \$shorewall_dir,
|
||||||
'verbose=i' => \$verbose,
|
'verbose=i' => \$verbose,
|
||||||
@ -49,4 +48,6 @@ if ( $shorewall_dir ne '' ) {
|
|||||||
fatal_error "$shorewall_dir is not an existing directory" unless -d $shorewall_dir;
|
fatal_error "$shorewall_dir is not an existing directory" unless -d $shorewall_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
usage unless @ARGV < 2;
|
||||||
|
|
||||||
compiler $ARGV[0];
|
compiler $ARGV[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user