diff options
author | Jim Ingham <jingham@apple.com> | 2012-10-06 00:27:04 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2012-10-06 00:27:04 +0000 |
commit | 215341c25bed42510dd62c1161bcea42ffd20585 (patch) | |
tree | 8ed486b7b1be183677a80f8ef644af9beb378eae /lldb/source/Interpreter/CommandObjectRegexCommand.cpp | |
parent | ffe2d52a066678b17539960ba945f2e07899a716 (diff) | |
download | bcm5719-llvm-215341c25bed42510dd62c1161bcea42ffd20585.tar.gz bcm5719-llvm-215341c25bed42510dd62c1161bcea42ffd20585.zip |
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
Diffstat (limited to 'lldb/source/Interpreter/CommandObjectRegexCommand.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandObjectRegexCommand.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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"); |