From 215341c25bed42510dd62c1161bcea42ffd20585 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Sat, 6 Oct 2012 00:27:04 +0000 Subject: 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 --- lldb/source/Interpreter/CommandObjectRegexCommand.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lldb/source/Interpreter/CommandObjectRegexCommand.cpp') diff --git a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp index 27a67e5e02c..1fc23a372c3 100644 --- a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp +++ b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp @@ -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"); -- cgit v1.2.3