mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
Improve error message for invalid chat mode and list valid modes.
This commit is contained in:
parent
98984564d6
commit
4f30db4f51
1 changed files with 3 additions and 3 deletions
|
@ -57,13 +57,13 @@ class Commands:
|
|||
|
||||
if ef not in [format[0] for format in valid_formats]:
|
||||
if ef:
|
||||
self.io.tool_error(f"Edit format \"{ef}\" must be one of:")
|
||||
self.io.tool_error(f"Chat mode \"{ef}\" must be one of:\n")
|
||||
else:
|
||||
self.io.tool_error(f"Edit format must be one of:")
|
||||
self.io.tool_output(f"Chat mode must be one of:\n")
|
||||
|
||||
max_format_length = max(len(format) for format, _ in valid_formats)
|
||||
for format, description in valid_formats:
|
||||
self.io.tool_error(f"- {format:<{max_format_length}} : {description}")
|
||||
self.io.tool_output(f"- {format:<{max_format_length}} {description}")
|
||||
return
|
||||
|
||||
raise SwitchCoder(edit_format=ef)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue