diff options
author | Jim Ingham <jingham@apple.com> | 2018-12-21 01:45:28 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2018-12-21 01:45:28 +0000 |
commit | 79d8105fc80b866358c7175aab9bcd4a3e7ac974 (patch) | |
tree | 5995f80152d5f98e4bc249f4ce0f191dd35d5d94 /lldb/source/Commands/CommandObjectHelp.cpp | |
parent | b894ecf9033e2d205fd8c5b82fe7b7df7f8dca7c (diff) | |
download | llvm-79d8105fc80b866358c7175aab9bcd4a3e7ac974.zip llvm-79d8105fc80b866358c7175aab9bcd4a3e7ac974.tar.gz llvm-79d8105fc80b866358c7175aab9bcd4a3e7ac974.tar.bz2 |
"help finish" tells you it is an alias. "help fin" doesn't.
They both run the same command, and people get used to typing the shortest
string they can, so we should support alias info on shortened strings as well.
<rdar://problem/46859207>
llvm-svn: 349874
Diffstat (limited to 'lldb/source/Commands/CommandObjectHelp.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectHelp.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp index 9f75e62..1f1d63d 100644 --- a/lldb/source/Commands/CommandObjectHelp.cpp +++ b/lldb/source/Commands/CommandObjectHelp.cpp @@ -167,10 +167,13 @@ bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) { } sub_cmd_obj->GenerateHelpText(result); - - if (m_interpreter.AliasExists(command_name)) { + std::string alias_full_name; + // Don't use AliasExists here, that only checks exact name matches. If + // the user typed a shorter unique alias name, we should still tell them + // it was an alias. + if (m_interpreter.GetAliasFullName(command_name, alias_full_name)) { StreamString sstr; - m_interpreter.GetAlias(command_name)->GetAliasExpansion(sstr); + m_interpreter.GetAlias(alias_full_name)->GetAliasExpansion(sstr); result.GetOutputStream().Printf("\n'%s' is an abbreviation for %s\n", command[0].c_str(), sstr.GetData()); } |