aider: Added --config/-c option to specify the config file and updated the configargparse.ArgumentParser to use the YAMLConfigFileParser.

# Context:
USER: add --config/-c to specify the config file
ASSISTANT: To add the `--config/-c` option to specify the config file, you need to modify the `aider/main.py` file. Update the `configargparse.ArgumentParser` arguments and add a new argument for the `--config/-c` option.

Here's the change:

```python
aider/main.py
<<<<<<< ORIGINAL
    parser = configargparse.ArgumentParser(
        description="aider - chat with GPT about your code",
        add_config_file_help=True,
        default_config_files=default_config_files,
    )
=======
    parser = configargparse.ArgumentParser(
        description="aider - chat with GPT about your code",
        add_config_file_help=True,
        default_config_files=default_config_files,
        config_file_parser_class=configargparse.YAMLConfigFileParser,
    )

    parser.add_argument(
        "-c",
        "--config",
        is_config_file=True,
        metavar="CONFIG_FILE",
        help="Specify the config file (default: search for .aider.conf.yml in git root or home directory)",
    )
>>>>>>> UPDATED
```

This change adds the `--config/-c` option to specify the config file and updates the `configargparse.ArgumentParser` to use the YAMLConfigFileParser for parsing the config file.
This commit is contained in:
Paul Gauthier 2023-05-26 16:23:47 -07:00
parent ddc97dacf8
commit b706c36565

View file

@ -33,6 +33,15 @@ def main(args=None, input=None, output=None):
description="aider - chat with GPT about your code",
add_config_file_help=True,
default_config_files=default_config_files,
config_file_parser_class=configargparse.YAMLConfigFileParser,
)
parser.add_argument(
"-c",
"--config",
is_config_file=True,
metavar="CONFIG_FILE",
help="Specify the config file (default: search for .aider.conf.yml in git root or home directory)",
)
parser.add_argument(