From 01a9a8ffc446e353814706a1eb0c1ec4cde1637e Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 12 Aug 2024 18:22:05 -0700 Subject: [PATCH] feat: add event logging for command usage --- aider/commands.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aider/commands.py b/aider/commands.py index 599d5013d..74424ddc6 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -194,6 +194,7 @@ class Commands: def run(self, inp): if inp.startswith("!"): + self.coder.event("command_run") return self.do_run("run", inp[1:]) res = self.matching_commands(inp) @@ -201,8 +202,10 @@ class Commands: return matching_commands, first_word, rest_inp = res if len(matching_commands) == 1: + self.coder.event(f"command_{matching_commands[0][1:]}") return self.do_run(matching_commands[0][1:], rest_inp) elif first_word in matching_commands: + self.coder.event(f"command_{first_word[1:]}") return self.do_run(first_word[1:], rest_inp) elif len(matching_commands) > 1: self.io.tool_error(f"Ambiguous command: {', '.join(matching_commands)}")