ENH: add better error checking

This commit is contained in:
Bill Hoffman 2001-06-04 18:23:58 -04:00
parent 815ca6bbdc
commit c57d16eb41

View File

@ -84,6 +84,21 @@ bool cmSetCommand::Invoke(std::vector<std::string>& args)
value = args[1]; value = args[1];
cacheStart = 2; cacheStart = 2;
} }
else
{
std::string message;
message += "Syntax error in SET:\n";
message += "CACHE requires TYPE and document string SET command:\n";
message += "SET (";
for(std::vector<std::string>::iterator i = args.begin();
i != args.end(); ++i)
{
message += *i;
}
message += ")\n";
this->SetError(message.c_str());
return false;
}
if(cache) if(cache)
{ {
if(args[cacheStart] != "CACHE") if(args[cacheStart] != "CACHE")