add more syntax checking

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7274 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2010-08-27 12:26:16 +00:00
parent 56a369164b
commit f26fb62a6c

View File

@ -40,7 +40,6 @@ $::command = "$0 $args";
Getopt::Long::Configure("bundling");
$Getopt::Long::ignorecase = 0;
my ($directory, $help, $version, $filelist);
$directory = "$::XCATROOT/lib/perl/xCAT_schema"; # default
# parse the options
if (
@ -62,7 +61,6 @@ if ($help)
&usage;
exit(0);
}
# display the version statement if -v or --version is specified
if ($version)
{
@ -70,6 +68,17 @@ if ($version)
xCAT::MsgUtils->message("I", $version);
exit 0;
}
if (($filelist) && ($directory))
{
xCAT::MsgUtils->message("E","Cannot enter both the -f and -d flags.");
exit 1;
}
if (!($filelist)) { # if no file list and no directory set default
if (!($directory)) {
$directory = "$::XCATROOT/lib/perl/xCAT_schema";
}
}
my @filearray;
if ($filelist)
{ # use filelist