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.
This commit is contained in:
Paul Gauthier 2023-05-26 16:04:39 -07:00
parent 43413654bd
commit 81f3c7ac7e

View file

@ -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",