From 4537e6c16a4103c5ad98740d1fb940f594eb9a63 Mon Sep 17 00:00:00 2001 From: "Your Name (aider)" Date: Sun, 28 Jul 2024 17:47:50 -0300 Subject: [PATCH] Validate edit format and show error if invalid --- aider/commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aider/commands.py b/aider/commands.py index 1ec1f95fc..d014db6b2 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -51,6 +51,10 @@ class Commands: ef = args.strip() valid_formats = "diff udiff whole".split() + if ef not in valid_formats: + self.io.tool_error(f"Invalid edit format: {ef}. Valid formats are: {', '.join(valid_formats)}") + return + raise SwitchModel(edit_format=ef) def completions_model(self):