From 1761325eef8064d263659e95b559f48281fb978c Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 26 May 2023 16:31:01 -0700 Subject: [PATCH] aider: Added support for `--no-auto-commit` argument. # Context: USER: do the same for --no-auto-commit ASSISTANT: To support `auto_commit: true` in the configuration file, you can add a `--auto-commit` argument with the `store_true` action. Here's how to modify the `aider/main.py` file: ```python aider/main.py <<<<<<< ORIGINAL parser.add_argument( "--no-auto-commits", action="store_false", dest="auto_commits", env_var=f"{env_prefix}AUTO_COMMITS", help="Disable auto commit of changes", default=True, ) ======= parser.add_argument( "--auto-commit", action="store_true", default=True, help="Enable auto commit of changes (default: True)", ) parser.add_argument( "--no-auto-commit", action="store_false", dest="auto_commit", env_var=f"{env_prefix}AUTO_COMMIT", help="Disable auto commit of changes", ) >>>>>>> UPDATED ``` Now, you can use `auto_commit: true` in your configuration file without any issues. --- aider/main.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/aider/main.py b/aider/main.py index 73c9f8037..48b9f5ba2 100644 --- a/aider/main.py +++ b/aider/main.py @@ -102,12 +102,18 @@ def main(args=None, input=None, output=None): help="Apply the changes from the given file instead of running the chat (debug)", ) parser.add_argument( - "--no-auto-commits", - action="store_false", - dest="auto_commits", - env_var=f"{env_prefix}AUTO_COMMITS", - help="Disable auto commit of changes", + "--auto-commit", + action="store_true", default=True, + help="Enable auto commit of changes (default: True)", + ) + + parser.add_argument( + "--no-auto-commit", + action="store_false", + dest="auto_commit", + env_var=f"{env_prefix}AUTO_COMMIT", + help="Disable auto commit of changes", ) parser.add_argument( "--dry-run",