From 46d4aa211ff9e84d8f71aafe818804758133b8aa Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Mon, 29 Feb 2016 23:22:53 +0000 Subject: When 'help' cannot find a command, produce additional help text that also points the user to the apropos and type lookup commands This is useful in cases such as, e.g. (lldb) help NSString (the user meant type lookup) or (lldb) help kill (the user is looking for process kill) Fixes rdar://24868537 llvm-svn: 262271 --- lldb/source/Commands/CommandObjectCommands.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lldb/source/Commands/CommandObjectCommands.cpp') diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 046698491d8..e2e2bb81ea0 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -14,6 +14,7 @@ // Project includes #include "CommandObjectCommands.h" +#include "CommandObjectHelp.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/IOHandler.h" #include "lldb/Core/StringList.h" @@ -920,8 +921,16 @@ protected: } else { - result.AppendErrorWithFormat ("'%s' is not a known command.\nTry 'help' to see a current list of commands.\n", - command_name); + StreamString error_msg_stream; + const bool generate_apropos = true; + const bool generate_type_lookup = false; + CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage(&error_msg_stream, + command_name, + nullptr, + nullptr, + generate_apropos, + generate_type_lookup); + result.AppendErrorWithFormat ("%s", error_msg_stream.GetData()); result.SetStatus (eReturnStatusFailed); } } -- cgit v1.2.3