From 79c414d8415216688fb3685604cf1b9360b929d3 Mon Sep 17 00:00:00 2001 From: lissav Date: Fri, 18 Jul 2008 12:03:49 +0000 Subject: [PATCH] add use strict git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1889 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/xdsh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/xCAT-client/bin/xdsh b/xCAT-client/bin/xdsh index 6e1f804b2..c727083a0 100644 --- a/xCAT-client/bin/xdsh +++ b/xCAT-client/bin/xdsh @@ -6,6 +6,7 @@ BEGIN $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; +use strict; use File::Basename; #use Data::Dumper; use Getopt::Long; @@ -50,16 +51,22 @@ my $arg = shift(@SaveARGV); if ($arg =~ /^-/) # no noderange { - push @{$cmdref->{arg}}, $arg; - foreach (@SAVEARGV) - { - push(@{$cmdref->{arg}}, $_); - } - @ARGV = @{$cmdref->{arg}}; # save just the argument to parse + xCAT::MsgUtils->message( + "I", + "Node range not specified, see man page for syntax.\n" + ); + exit 1; } else { $cmdref->{noderange}->[0] = $arg; # save noderange + if (!($cmdref->{noderange}->[0])) { + xCAT::MsgUtils->message( + "I", + "Node range not specified, see man page for syntax.\n" + ); + exit 1; + } @ARGV = @SaveARGV; # noderange removed for parsing } @@ -77,7 +84,6 @@ foreach (@SaveARGV) { push(@{$cmdref->{arg}}, $_); } - # add environment variables, if they have not already been assigned with # command line flags if (!($::NODE_RSH))