diff options
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 22 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectMultiword.cpp | 8 |
2 files changed, 7 insertions, 23 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index e2e2bb81ea0..d5816db0dbf 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -635,21 +635,13 @@ protected: if (m_interpreter.AliasExists (alias_command.c_str()) || m_interpreter.UserCommandExists (alias_command.c_str())) { - OptionArgVectorSP temp_option_arg_sp (m_interpreter.GetAliasOptions (alias_command.c_str())); - if (temp_option_arg_sp) - { - if (option_arg_vector->empty()) - m_interpreter.RemoveAliasOptions (alias_command.c_str()); - } result.AppendWarningWithFormat ("Overwriting existing definition for '%s'.\n", alias_command.c_str()); } if (cmd_obj_sp) { - m_interpreter.AddAlias (alias_command.c_str(), cmd_obj_sp); - if (!option_arg_vector->empty()) - m_interpreter.AddOrReplaceAliasOptions (alias_command.c_str(), option_arg_vector_sp); + m_interpreter.AddAlias (alias_command.c_str(), cmd_obj_sp, option_arg_vector_sp); result.SetStatus (eReturnStatusSuccessFinishNoResult); } else @@ -747,22 +739,14 @@ protected: if (m_interpreter.AliasExists (alias_command.c_str()) || m_interpreter.UserCommandExists (alias_command.c_str())) { - OptionArgVectorSP tmp_option_arg_sp (m_interpreter.GetAliasOptions (alias_command.c_str())); - if (tmp_option_arg_sp) - { - if (option_arg_vector->empty()) - m_interpreter.RemoveAliasOptions (alias_command.c_str()); - } result.AppendWarningWithFormat ("Overwriting existing definition for '%s'.\n", alias_command.c_str()); } if (use_subcommand) - m_interpreter.AddAlias (alias_command.c_str(), subcommand_obj_sp); + m_interpreter.AddAlias (alias_command.c_str(), subcommand_obj_sp, option_arg_vector_sp); else - m_interpreter.AddAlias (alias_command.c_str(), command_obj_sp); - if (!option_arg_vector->empty()) - m_interpreter.AddOrReplaceAliasOptions (alias_command.c_str(), option_arg_vector_sp); + m_interpreter.AddAlias (alias_command.c_str(), command_obj_sp, option_arg_vector_sp); result.SetStatus (eReturnStatusSuccessFinishNoResult); } else diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index 6d35c9cec1f..18e162dcec4 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -56,7 +56,7 @@ CommandObjectMultiword::GetSubcommandSP (const char *sub_cmd, StringList *matche StringList local_matches; if (matches == nullptr) matches = &local_matches; - int num_matches = CommandObject::AddNamesMatchingPartialString (m_subcommand_dict, sub_cmd, *matches); + int num_matches = AddNamesMatchingPartialString (m_subcommand_dict, sub_cmd, *matches); if (num_matches == 1) { @@ -227,9 +227,9 @@ CommandObjectMultiword::HandleCompletion(Args &input, const char *arg0 = input.GetArgumentAtIndex(0); if (cursor_index == 0) { - CommandObject::AddNamesMatchingPartialString (m_subcommand_dict, - arg0, - matches); + AddNamesMatchingPartialString (m_subcommand_dict, + arg0, + matches); if (matches.GetSize() == 1 && matches.GetStringAtIndex(0) != nullptr |