From d7d5f9609f52ee071947407a045b92304a27eea9 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Sat, 25 May 2013 16:58:13 +0000 Subject: [PATCH] Cleanly handle unsupported switches git-svn-id: http://svn.osgeo.org/postgis/trunk@11499 b70326c6-7e19-0410-871a-916f4a2858ee --- utils/postgis_restore.pl.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/utils/postgis_restore.pl.in b/utils/postgis_restore.pl.in index c14626b2a..1ee1c6180 100755 --- a/utils/postgis_restore.pl.in +++ b/utils/postgis_restore.pl.in @@ -59,14 +59,20 @@ my $SRID_MAXIMUM = @SRID_MAXIMUM@; my $SRID_USER_MAXIMUM = @SRID_USER_MAXIMUM@; while (@ARGV && $ARGV[0] =~ /-/) { - if ( $ARGV[0] eq '-v' ) { + my $arg = shift(@ARGV); + if ( $arg eq '-v' ) { $DEBUG = 1; - shift(@ARGV); } - elsif ( $ARGV[0] eq '-s' ) { - shift(@ARGV); + elsif ( $arg eq '-s' ) { $POSTGIS_SCHEMA = shift(@ARGV); } + elsif ( $arg eq '--' ) { + last; + } + else { + print STDERR "Unknown switch " . $arg; + die $usage; + } } die $usage if (@ARGV < 1); -- 2.50.1