From b95150418fb6e2d22a0bd84abcdc1f3cc7e5a0bf Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Thu, 13 Jan 2022 16:02:45 -0800 Subject: [lldb] Allow aliases to aliases of raw input commands Allow users to create aliases for aliases to raw input commands. That probably sounds convoluted, so here's an example: ``` command alias some-setup env SOMEVAR=SOMEVALUE ``` This an alias based on `env`, which itself is an alias for `_regex-env`. `_regex-env` is a `command regex` command, which takes raw input. The above `some-setup` alias fails with: ``` error: Unable to create requested alias. ``` This change allows such aliases to be created. lldb already supports aliases to aliases for parsed commands. Differential Revision: https://reviews.llvm.org/D117259 --- lldb/source/Commands/CommandObjectCommands.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lldb/source/Commands/CommandObjectCommands.cpp') diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 1ec54cf..defa21a 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -485,8 +485,9 @@ protected: OptionArgVectorSP option_arg_vector_sp = OptionArgVectorSP(new OptionArgVector); - if (CommandObjectSP cmd_obj_sp = - m_interpreter.GetCommandSPExact(cmd_obj.GetCommandName())) { + const bool include_aliases = true; + if (CommandObjectSP cmd_obj_sp = m_interpreter.GetCommandSPExact( + cmd_obj.GetCommandName(), include_aliases)) { if (m_interpreter.AliasExists(alias_command) || m_interpreter.UserCommandExists(alias_command)) { result.AppendWarningWithFormat( -- cgit v1.1