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))