From 81f3c7ac7ee58d0402cac80dc3e02e3a834d2040 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 26 May 2023 16:04:39 -0700 Subject: [PATCH] aider: Changed default value of `--ctags` to `None` and allowed it to be set to `true` or `false` via the command line or config. # Context: USER: --ctags should default to None now. it should be possible to set it to true or false via cmd line or config ASSISTANT: To make the `--ctags` option default to `None` and allow it to be set to `true` or `false` via the command line or config, you need to modify the `aider/main.py` file. Here's the change: ```python aider/main.py <<<<<<< ORIGINAL parser.add_argument( "--ctags", action="store_true", env_var=f"{env_prefix}CTAGS", help="Add ctags to the chat to help GPT understand the codebase (default: False)", default=False, ) ======= parser.add_argument( "--ctags", type=lambda x: (str(x).lower() == 'true'), nargs='?', const=True, default=None, env_var=f"{env_prefix}CTAGS", help="Add ctags to the chat to help GPT understand the codebase (default: None)", ) >>>>>>> UPDATED ``` This change will make the `--ctags` option default to `None` and allow it to be set to `true` or `false` via the command line or config. --- aider/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aider/main.py b/aider/main.py index eb7ce70d6..093c744fc 100644 --- a/aider/main.py +++ b/aider/main.py @@ -105,10 +105,12 @@ def main(args=None, input=None, output=None): ) parser.add_argument( "--ctags", - action="store_true", + type=lambda x: (str(x).lower() == 'true'), + nargs='?', + const=True, + default=None, env_var=f"{env_prefix}CTAGS", - help="Add ctags to the chat to help GPT understand the codebase (default: False)", - default=False, + help="Add ctags to the chat to help GPT understand the codebase (default: None)", ) parser.add_argument( "--yes",