Browse Source

ENH: add better error checking

Bill Hoffman 24 years ago
parent
commit
c57d16eb41
1 changed files with 15 additions and 0 deletions
  1. 15 0
      Source/cmSetCommand.cxx

+ 15 - 0
Source/cmSetCommand.cxx

@@ -84,6 +84,21 @@ bool cmSetCommand::Invoke(std::vector<std::string>& args)
     value = args[1];
     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(args[cacheStart] != "CACHE")