diff options
Diffstat (limited to 'lldb/source/Interpreter/CommandAlias.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandAlias.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/CommandAlias.cpp b/lldb/source/Interpreter/CommandAlias.cpp index f9929b45ca3..f7d8e8e9f1b 100644 --- a/lldb/source/Interpreter/CommandAlias.cpp +++ b/lldb/source/Interpreter/CommandAlias.cpp @@ -87,7 +87,9 @@ CommandAlias::CommandAlias (CommandInterpreter &interpreter, m_underlying_command_sp(), m_option_string(options_args ? options_args : ""), m_option_args_sp(new OptionArgVector), -m_is_dashdash_alias(eLazyBoolCalculate) +m_is_dashdash_alias(eLazyBoolCalculate), +m_did_set_help(false), +m_did_set_help_long(false) { if (ProcessAliasOptionsArgs(cmd_sp, options_args, m_option_args_sp)) { @@ -259,10 +261,24 @@ CommandAlias::Desugar () // allow CommandAlias objects to provide their own help, but fallback to the info // for the underlying command if no customization has been provided +void +CommandAlias::SetHelp (const char * str) +{ + this->CommandObject::SetHelp(str); + m_did_set_help = true; +} + +void +CommandAlias::SetHelpLong (const char * str) +{ + this->CommandObject::SetHelpLong(str); + m_did_set_help_long = true; +} + const char* CommandAlias::GetHelp () { - if (!m_cmd_help_short.empty()) + if (!m_cmd_help_short.empty() || m_did_set_help) return m_cmd_help_short.c_str(); if (IsValid()) return m_underlying_command_sp->GetHelp(); @@ -272,7 +288,7 @@ CommandAlias::GetHelp () const char* CommandAlias::GetHelpLong () { - if (!m_cmd_help_long.empty()) + if (!m_cmd_help_long.empty() || m_did_set_help_long) return m_cmd_help_long.c_str(); if (IsValid()) return m_underlying_command_sp->GetHelpLong(); |