mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 10:45:00 +00:00
feat: add event logging for command usage
This commit is contained in:
parent
aa840f0e28
commit
01a9a8ffc4
1 changed files with 3 additions and 0 deletions
|
@ -194,6 +194,7 @@ class Commands:
|
||||||
|
|
||||||
def run(self, inp):
|
def run(self, inp):
|
||||||
if inp.startswith("!"):
|
if inp.startswith("!"):
|
||||||
|
self.coder.event("command_run")
|
||||||
return self.do_run("run", inp[1:])
|
return self.do_run("run", inp[1:])
|
||||||
|
|
||||||
res = self.matching_commands(inp)
|
res = self.matching_commands(inp)
|
||||||
|
@ -201,8 +202,10 @@ class Commands:
|
||||||
return
|
return
|
||||||
matching_commands, first_word, rest_inp = res
|
matching_commands, first_word, rest_inp = res
|
||||||
if len(matching_commands) == 1:
|
if len(matching_commands) == 1:
|
||||||
|
self.coder.event(f"command_{matching_commands[0][1:]}")
|
||||||
return self.do_run(matching_commands[0][1:], rest_inp)
|
return self.do_run(matching_commands[0][1:], rest_inp)
|
||||||
elif first_word in matching_commands:
|
elif first_word in matching_commands:
|
||||||
|
self.coder.event(f"command_{first_word[1:]}")
|
||||||
return self.do_run(first_word[1:], rest_inp)
|
return self.do_run(first_word[1:], rest_inp)
|
||||||
elif len(matching_commands) > 1:
|
elif len(matching_commands) > 1:
|
||||||
self.io.tool_error(f"Ambiguous command: {', '.join(matching_commands)}")
|
self.io.tool_error(f"Ambiguous command: {', '.join(matching_commands)}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue