summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectCommands.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2016-02-29 23:22:53 +0000
committerEnrico Granata <egranata@apple.com>2016-02-29 23:22:53 +0000
commit46d4aa211ff9e84d8f71aafe818804758133b8aa (patch)
treee0b3359f9b1e2d1ea78ec80b81e23675eb4e245f /lldb/source/Commands/CommandObjectCommands.cpp
parentefc091f457c98ecf86498fe0fd45c81a58d4a2ab (diff)
downloadbcm5719-llvm-46d4aa211ff9e84d8f71aafe818804758133b8aa.tar.gz
bcm5719-llvm-46d4aa211ff9e84d8f71aafe818804758133b8aa.zip
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
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp13
1 files changed, 11 insertions, 2 deletions
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);
}
}
OpenPOWER on IntegriCloud