summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectApropos.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-09-18 01:14:36 +0000
committerGreg Clayton <gclayton@apple.com>2010-09-18 01:14:36 +0000
commita701509229f658eac7c10bd6aa54cf6ed5b5011d (patch)
treeb38ff5cfb3fd466e5c7f89cea9bd9fa7d89eed16 /lldb/source/Commands/CommandObjectApropos.cpp
parent9a587aaaa9e7bed09477c3c8d51d8f44dfd99158 (diff)
downloadbcm5719-llvm-a701509229f658eac7c10bd6aa54cf6ed5b5011d.tar.gz
bcm5719-llvm-a701509229f658eac7c10bd6aa54cf6ed5b5011d.zip
Fixed the way set/show variables were being accessed to being natively
accessed by the objects that own the settings. The previous approach wasn't very usable and made for a lot of unnecessary code just to access variables that were already owned by the objects. While I fixed those things, I saw that CommandObject objects should really have a reference to their command interpreter so they can access the terminal with if they want to output usaage. Fixed up all CommandObjects to take an interpreter and cleaned up the API to not need the interpreter to be passed in. Fixed the disassemble command to output the usage if no options are passed down and arguments are passed (all disassebmle variants take options, there are no "args only"). llvm-svn: 114252
Diffstat (limited to 'lldb/source/Commands/CommandObjectApropos.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectApropos.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp
index 36494708b75..a0184646de7 100644
--- a/lldb/source/Commands/CommandObjectApropos.cpp
+++ b/lldb/source/Commands/CommandObjectApropos.cpp
@@ -26,10 +26,11 @@ using namespace lldb_private;
// CommandObjectApropos
//-------------------------------------------------------------------------
-CommandObjectApropos::CommandObjectApropos () :
- CommandObject ("apropos",
- "Find a list of debugger commands related to a particular word/subject.",
- "apropos <search-word>")
+CommandObjectApropos::CommandObjectApropos (CommandInterpreter &interpreter) :
+ CommandObject (interpreter,
+ "apropos",
+ "Find a list of debugger commands related to a particular word/subject.",
+ "apropos <search-word>")
{
}
@@ -41,7 +42,6 @@ CommandObjectApropos::~CommandObjectApropos()
bool
CommandObjectApropos::Execute
(
- CommandInterpreter &interpreter,
Args& args,
CommandReturnObject &result
)
@@ -58,7 +58,7 @@ CommandObjectApropos::Execute
// is private.
StringList commands_found;
StringList commands_help;
- interpreter.FindCommandsForApropos (search_word, commands_found, commands_help);
+ m_interpreter.FindCommandsForApropos (search_word, commands_found, commands_help);
if (commands_found.GetSize() == 0)
{
result.AppendMessageWithFormat ("No commands found pertaining to '%s'.", search_word);
@@ -77,12 +77,12 @@ CommandObjectApropos::Execute
}
for (size_t i = 0; i < commands_found.GetSize(); ++i)
- interpreter.OutputFormattedHelpText (result.GetOutputStream(),
- commands_found.GetStringAtIndex(i),
- "--", commands_help.
- GetStringAtIndex(i),
- max_len);
-
+ m_interpreter.OutputFormattedHelpText (result.GetOutputStream(),
+ commands_found.GetStringAtIndex(i),
+ "--", commands_help.
+ GetStringAtIndex(i),
+ max_len);
+
}
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
OpenPOWER on IntegriCloud