diff --git a/aider/commands.py b/aider/commands.py index eb3a5f534..0fba2b68b 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -13,18 +13,24 @@ class Commands: return commands + def do_run(self, cmd_name, args): + pass + def run(self, inp, console): words = inp.strip().split() if not words: return first_word = words[0] + rest_inp = inp[len(words[0]):] + all_commands = self.get_commands() matching_commands = [cmd for cmd in all_commands if cmd.startswith(first_word)] if len(matching_commands) == 1: console.print('[green]run', matching_commands[0]) + self.do_run(matching_commands[0][1:], rest_inp) elif len(matching_commands) > 1: - console.print('[yellow]Partial matches:', ', '.join(matching_commands)) + console.print('[red]Ambiguous command:', ', '.join(matching_commands)) else: - console.print('[red]Error: Command not found') + console.print(f'[red]Error: {first_word} is not a valid command.')