fix: Correct line/lines pluralization in command output messages

This commit is contained in:
Paul Gauthier (aider) 2024-11-21 06:30:52 -08:00
parent 2619b92131
commit 7aa4e44317
2 changed files with 4 additions and 2 deletions

View file

@ -2065,5 +2065,6 @@ class Coder:
"Add command output to the chat?", allow_never=True
):
num_lines = len(accumulated_output.strip().splitlines())
self.io.tool_output(f"Added {num_lines} lines of output to the chat.")
line_plural = "line" if num_lines == 1 else "lines"
self.io.tool_output(f"Added {num_lines} {line_plural} of output to the chat.")
return accumulated_output

View file

@ -880,7 +880,8 @@ class Commands:
if add:
num_lines = len(combined_output.strip().splitlines())
self.io.tool_output(f"Added {num_lines} lines of output to the chat.")
line_plural = "line" if num_lines == 1 else "lines"
self.io.tool_output(f"Added {num_lines} {line_plural} of output to the chat.")
msg = prompts.run_output.format(
command=args,