mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
Improve error message for invalid edit format in aider/commands.py
.
This commit is contained in:
parent
44ca351e4c
commit
09a52f81f1
1 changed files with 4 additions and 6 deletions
|
@ -50,12 +50,10 @@ class Commands:
|
||||||
ef = args.strip()
|
ef = args.strip()
|
||||||
valid_formats = [coder.edit_format for coder in coders.__all__ if getattr(coder, 'edit_format', None)]
|
valid_formats = [coder.edit_format for coder in coders.__all__ if getattr(coder, 'edit_format', None)]
|
||||||
|
|
||||||
self.io.tool_output("Valid edit formats:")
|
|
||||||
for format in valid_formats:
|
|
||||||
self.io.tool_output(f"• {format}")
|
|
||||||
|
|
||||||
if ef not in valid_formats:
|
if ef not in valid_formats:
|
||||||
self.io.tool_error(f"Edit format \"{ef}\" is not valid.")
|
self.io.tool_error(f"Edit format \"{ef}\" must be one of:")
|
||||||
|
for format in valid_formats:
|
||||||
|
self.io.tool_error(f"- {format}")
|
||||||
return
|
return
|
||||||
|
|
||||||
raise SwitchCoder(edit_format=ef)
|
raise SwitchCoder(edit_format=ef)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue