From 2ec6757f86cc5d415b6635a1585459518aeda839 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 27 May 2023 15:21:57 -0700 Subject: [PATCH] aider: Added new arguments `--user-input-color`, `--tool-output-color`, and `--tool-error-color` to `main` function and passed them to `InputOutput` class. # Context: USER: add args --user-input-color default green, --tool-output-color default None and --tool-error-color default red. pass them to InputOutput ASSISTANT: I will add the new arguments to the `main` function and pass them to the `InputOutput` class. ```python aider/main.py <<<<<<< ORIGINAL parser.add_argument( "--pretty", action="store_true", default=True, help="Enable pretty, colorized output (default: True)", ) parser.add_argument( "--no-pretty", action="store_false", dest="pretty", help="Disable pretty, colorized output", ) ======= parser.add_argument( "--pretty", action="store_true", default=True, help="Enable pretty, colorized output (default: True)", ) parser.add_argument( "--no-pretty", action="store_false", dest="pretty", help="Disable pretty, colorized output", ) parser.add_argument( "--user-input-color", default="green", help="Set the color for user input (default: green)", ) parser.add_argument( "--tool-output-color", default=None, help="Set the color for tool output (default: None)", ) parser.add_argument( "--tool-error-color", default="red", help="Set the color for tool error messages (default: red)", ) >>>>>>> UPDATED ``` ```python aider/main.py <<<<<<< ORIGINAL io = InputOutput( args.pretty, args.yes, args.input_history_file, args.chat_history_file, input=input, output=output, ) ======= io = InputOutput( args.pretty, args.yes, args.input_history_file, args.chat_history_file, input=input, output=output, user_input_color=args.user_input_color, tool_output_color=args.tool_output_color, tool_error_color=args.tool_error_color, ) >>>>>>> UPDATED ``` Now the new arguments are added and passed to the `InputOutput` class. --- aider/main.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/aider/main.py b/aider/main.py index 5cbf53c27..6fb51cb06 100644 --- a/aider/main.py +++ b/aider/main.py @@ -95,6 +95,21 @@ def main(args=None, input=None, output=None): dest="pretty", help="Disable pretty, colorized output", ) + parser.add_argument( + "--user-input-color", + default="green", + help="Set the color for user input (default: green)", + ) + parser.add_argument( + "--tool-output-color", + default=None, + help="Set the color for tool output (default: None)", + ) + parser.add_argument( + "--tool-error-color", + default="red", + help="Set the color for tool error messages (default: red)", + ) parser.add_argument( "--apply", metavar="FILE", @@ -178,6 +193,9 @@ def main(args=None, input=None, output=None): args.chat_history_file, input=input, output=output, + user_input_color=args.user_input_color, + tool_output_color=args.tool_output_color, + tool_error_color=args.tool_error_color, ) if args.verbose: