[Lldb-commits] [lldb] [lldb/Commands] Alias `script` command to `scripting execute` (PR #97263)

via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 1 17:22:32 PDT 2024


================
@@ -518,6 +518,15 @@ void CommandInterpreter::Initialize() {
     AddAlias("re", cmd_obj_sp);
   }
 
+  cmd_obj_sp = GetCommandSPExact("scripting execute");
+  if (cmd_obj_sp) {
+    AddAlias("sc", cmd_obj_sp);
+    AddAlias("scr", cmd_obj_sp);
+    AddAlias("scri", cmd_obj_sp);
+    AddAlias("scrip", cmd_obj_sp);
+    AddAlias("script", cmd_obj_sp);
----------------
jimingham wrote:

The problem is that if we have the command `scripting` and the alias `script` and we see `sc` we need to resolve that command ambiguity.  The only tool we have for ambiguous command resolution at present is "exact matches always win".

If we wanted to solve this w/o making all the exact matches we intend to win, we could add a ranking system to the commands and aliases, which bias ambiguous matches in favor of one or the other of the commands, or some similar system.  I worry that would get messy pretty quickly, but anyway, you'd need something like that.

https://github.com/llvm/llvm-project/pull/97263


More information about the lldb-commits mailing list