summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectMultiword.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-06-12 01:50:57 +0000
committerEnrico Granata <egranata@apple.com>2013-06-12 01:50:57 +0000
commit9b62d1d5ee32ec7abca5ed2fdfc079aab2168c2a (patch)
tree4a81d561c8821dd14d627e1daf6580ad238f508a /lldb/source/Commands/CommandObjectMultiword.cpp
parentf045007f117f91656a5d16ae004cfc3934c61c70 (diff)
downloadbcm5719-llvm-9b62d1d5ee32ec7abca5ed2fdfc079aab2168c2a.tar.gz
bcm5719-llvm-9b62d1d5ee32ec7abca5ed2fdfc079aab2168c2a.zip
<rdar://problem/11914077>
If you type help command <word> <word> <word> <missingSubCommand> (e.g. help script import or help type summary fake), you will get help on the deepest matched command word (i.e. script or type summary in the examples) Also, reworked the logic for commands to produce their help to make it more object-oriented llvm-svn: 183822
Diffstat (limited to 'lldb/source/Commands/CommandObjectMultiword.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectMultiword.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index bfb5132a644..f84b401f3aa 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -115,7 +115,7 @@ CommandObjectMultiword::Execute(const char *args_string, CommandReturnObject &re
const size_t argc = args.GetArgumentCount();
if (argc == 0)
{
- GenerateHelpText (result);
+ this->CommandObject::GenerateHelpText (result);
}
else
{
@@ -125,7 +125,7 @@ CommandObjectMultiword::Execute(const char *args_string, CommandReturnObject &re
{
if (::strcasecmp (sub_command, "help") == 0)
{
- GenerateHelpText (result);
+ this->CommandObject::GenerateHelpText (result);
}
else if (!m_subcommand_dict.empty())
{
@@ -181,12 +181,11 @@ CommandObjectMultiword::Execute(const char *args_string, CommandReturnObject &re
}
void
-CommandObjectMultiword::GenerateHelpText (CommandReturnObject &result)
+CommandObjectMultiword::GenerateHelpText (Stream &output_stream)
{
// First time through here, generate the help text for the object and
// push it to the return result object as well
- Stream &output_stream = result.GetOutputStream();
output_stream.PutCString ("The following subcommands are supported:\n\n");
CommandMap::iterator pos;
@@ -203,14 +202,14 @@ CommandObjectMultiword::GenerateHelpText (CommandReturnObject &result)
{
std::string help_text (pos->second->GetHelp());
help_text.append (" This command takes 'raw' input (no need to quote stuff).");
- m_interpreter.OutputFormattedHelpText (result.GetOutputStream(),
+ m_interpreter.OutputFormattedHelpText (output_stream,
indented_command.c_str(),
"--",
help_text.c_str(),
max_len);
}
else
- m_interpreter.OutputFormattedHelpText (result.GetOutputStream(),
+ m_interpreter.OutputFormattedHelpText (output_stream,
indented_command.c_str(),
"--",
pos->second->GetHelp(),
@@ -218,8 +217,6 @@ CommandObjectMultiword::GenerateHelpText (CommandReturnObject &result)
}
output_stream.PutCString ("\nFor more help on any particular subcommand, type 'help <command> <subcommand>'.\n");
-
- result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
int
OpenPOWER on IntegriCloud