From 24da10e021394d8fcf1e13c9a5e19f9df02ec39c Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 12 Mar 2014 11:33:27 -0400 Subject: [PATCH] fix parsing --- xCAT-server/lib/xcat/plugins/zone.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/zone.pm b/xCAT-server/lib/xcat/plugins/zone.pm index 7fc1146c5..1f7f75377 100644 --- a/xCAT-server/lib/xcat/plugins/zone.pm +++ b/xCAT-server/lib/xcat/plugins/zone.pm @@ -97,10 +97,14 @@ sub process_request @ARGV = @{$args}; # get arguments # Get the zonename if it is in the input my @SaveARGV = @ARGV; - my $zonename = @SaveARGV[0]; # here is the zonename, if there is one - if ($zonename) { # take zonename off the argument list so it will parse correctly - my $tmp = shift(@SaveARGV); - @ARGV = @SaveARGV; + my $zonename; + my $arg= @SaveARGV[0]; + if (!($arg =~ /-h/) && (!($arg =~ /-v/))) { # if not -h -v,then it must be a zone name + $zonename = @SaveARGV[0]; # here is the zonename, if there is one + if ($zonename) { # take zonename off the argument list so it will parse correctly + my $tmp = shift(@SaveARGV); + @ARGV = @SaveARGV; + } } Getopt::Long::Configure("posix_default"); Getopt::Long::Configure("no_gnu_compat");