diff options
author | Caroline Tice <ctice@apple.com> | 2010-10-28 23:17:48 +0000 |
---|---|---|
committer | Caroline Tice <ctice@apple.com> | 2010-10-28 23:17:48 +0000 |
commit | e79417951ba4107c662451bef89dd8fe5c65679b (patch) | |
tree | c5cbec6f48c4ba28e9247ba789679741ec97055b /lldb/source/Commands/CommandObjectHelp.cpp | |
parent | dbaf18361ea9da3120c575940f8d77d3618e5980 (diff) | |
download | llvm-e79417951ba4107c662451bef89dd8fe5c65679b.zip llvm-e79417951ba4107c662451bef89dd8fe5c65679b.tar.gz llvm-e79417951ba4107c662451bef89dd8fe5c65679b.tar.bz2 |
Add alias information, including aliased command options &
arguments, to help text for alias commands.
llvm-svn: 117617
Diffstat (limited to 'lldb/source/Commands/CommandObjectHelp.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectHelp.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp index c7aa2b4..07d80eb 100644 --- a/lldb/source/Commands/CommandObjectHelp.cpp +++ b/lldb/source/Commands/CommandObjectHelp.cpp @@ -69,6 +69,8 @@ CommandObjectHelp::Execute (Args& command, CommandReturnObject &result) // Get command object for the first command argument. Only search built-in command dictionary. StringList matches; cmd_obj = m_interpreter.GetCommandObject (command.GetArgumentAtIndex (0), &matches); + bool is_alias_command = m_interpreter.AliasExists (command.GetArgumentAtIndex (0)); + std::string alias_name = command.GetArgumentAtIndex(0); if (cmd_obj != NULL) { @@ -155,6 +157,13 @@ CommandObjectHelp::Execute (Args& command, CommandReturnObject &result) result.SetStatus (eReturnStatusSuccessFinishNoResult); } } + + if (is_alias_command) + { + StreamString sstr; + m_interpreter.GetAliasHelp (alias_name.c_str(), cmd_obj->GetCommandName(), sstr); + result.GetOutputStream().Printf ("\n'%s' is an abbreviation for %s\n", alias_name.c_str(), sstr.GetData()); + } } else if (matches.GetSize() > 0) { |