Commit 3c856405 authored by Brad King's avatar Brad King
Browse files

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.
parent c790b1fa
...@@ -90,7 +90,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, ...@@ -90,7 +90,7 @@ IsFunctionBlocked(const cmListFileFunction& lff,
if (errorString.size()) if (errorString.size())
{ {
std::string err = "had incorrect arguments: "; std::string err = "given arguments\n ";
unsigned int i; unsigned int i;
for(i =0; i < this->Functions[c].Arguments.size(); ++i) for(i =0; i < this->Functions[c].Arguments.size(); ++i)
{ {
...@@ -99,9 +99,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, ...@@ -99,9 +99,8 @@ IsFunctionBlocked(const cmListFileFunction& lff,
err += (this->Functions[c].Arguments[i].Quoted?"\"":""); err += (this->Functions[c].Arguments[i].Quoted?"\"":"");
err += " "; err += " ";
} }
err += "("; err += "\n";
err += errorString; err += errorString;
err += ").";
mf.IssueMessage(messType, err); mf.IssueMessage(messType, err);
if (messType == cmake::FATAL_ERROR) if (messType == cmake::FATAL_ERROR)
{ {
...@@ -181,7 +180,7 @@ bool cmIfCommand ...@@ -181,7 +180,7 @@ bool cmIfCommand
if (errorString.size()) if (errorString.size())
{ {
std::string err = "had incorrect arguments: "; std::string err = "given arguments\n ";
unsigned int i; unsigned int i;
for(i =0; i < args.size(); ++i) for(i =0; i < args.size(); ++i)
{ {
...@@ -190,9 +189,8 @@ bool cmIfCommand ...@@ -190,9 +189,8 @@ bool cmIfCommand
err += (args[i].Quoted?"\"":""); err += (args[i].Quoted?"\"":"");
err += " "; err += " ";
} }
err += "("; err += "\n";
err += errorString; err += errorString;
err += ").";
if (status == cmake::FATAL_ERROR) if (status == cmake::FATAL_ERROR)
{ {
this->SetError(err.c_str()); this->SetError(err.c_str());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment