Make the error message from regex commands use the command's syntax string if it exists rather than a generic but

not at all helpful message about not matching some unknown regex...

llvm-svn: 165349
This commit is contained in:
Jim Ingham
2012-10-06 00:27:04 +00:00
parent ffe2d52a06
commit 215341c25b

View File

@@ -82,9 +82,12 @@ CommandObjectRegexCommand::DoExecute
}
}
result.SetStatus(eReturnStatusFailed);
result.AppendErrorWithFormat ("Command contents '%s' failed to match any regular expression in the '%s' regex command.\n",
command,
m_cmd_name.c_str());
if (GetSyntax() != NULL)
result.AppendError (GetSyntax());
else
result.AppendErrorWithFormat ("Command contents '%s' failed to match any regular expression in the '%s' regex command.\n",
command,
m_cmd_name.c_str());
return false;
}
result.AppendError("empty command passed to regular expression command");