summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-06-17 18:18:08 (GMT)
committerBrad King <brad.king@kitware.com>2009-06-17 18:18:08 (GMT)
commit3c856405e457255e3db006c793d54d9cb69114cf (patch)
tree0628dc8ab14975869be48733c92417f8eacfb7a9
parentc790b1fabbc7b160bd67e1654a34964fd897a36c (diff)
downloadCMake-3c856405e457255e3db006c793d54d9cb69114cf.zip
CMake-3c856405e457255e3db006c793d54d9cb69114cf.tar.gz
CMake-3c856405e457255e3db006c793d54d9cb69114cf.tar.bz2
ENH: Improve format of if() command messages
Errors and warnings from the if() command always display the argument list given to the command followed by an explanation of the problem. This moves the argument list into a pre-formatted block and follows it with a paragraph-form explanation. The result looks cleaner.
-rw-r--r--Source/cmIfCommand.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index b4de8ff..2ab5eb2 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -90,7 +90,7 @@ IsFunctionBlocked(const cmListFileFunction& lff,
if (errorString.size())
{
- std::string err = "had incorrect arguments: ";
+ std::string err = "given arguments\n ";
unsigned int i;
for(i =0; i < this->Functions[c].Arguments.size(); ++i)
{
@@ -99,9 +99,8 @@ IsFunctionBlocked(const cmListFileFunction& lff,
err += (this->Functions[c].Arguments[i].Quoted?"\"":"");
err += " ";
}
- err += "(";
+ err += "\n";
err += errorString;
- err += ").";
mf.IssueMessage(messType, err);
if (messType == cmake::FATAL_ERROR)
{
@@ -181,7 +180,7 @@ bool cmIfCommand
if (errorString.size())
{
- std::string err = "had incorrect arguments: ";
+ std::string err = "given arguments\n ";
unsigned int i;
for(i =0; i < args.size(); ++i)
{
@@ -190,9 +189,8 @@ bool cmIfCommand
err += (args[i].Quoted?"\"":"");
err += " ";
}
- err += "(";
+ err += "\n";
err += errorString;
- err += ").";
if (status == cmake::FATAL_ERROR)
{
this->SetError(err.c_str());