mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
aider: Added a --no-auto-commits
argument and an environment variable.
# Context: USER: add a --no-auto-commits arg and env var "Do not automatically commit changes" ASSISTANT: To add a `--no-auto-commits` argument and an environment variable, we will update the `aider/main.py` file. We will add a new argument to the `argparse.ArgumentParser` and use the environment variable to set its default value. ```python aider/main.py <<<<<<< ORIGINAL parser.add_argument( "--show-diffs", action="store_true", help=f"Show diffs when committing changes (default: False, ${env_prefix}SHOW_DIFFS)", default=bool(int(os.environ.get(f"{env_prefix}SHOW_DIFFS", 0))), ) ======= parser.add_argument( "--no-auto-commits", action="store_true", help=f"Do not automatically commit changes (default: False, ${env_prefix}NO_AUTO_COMMITS)", default=bool(int(os.environ.get(f"{env_prefix}NO_AUTO_COMMITS", 0))), ) parser.add_argument( "--show-diffs", action="store_true", help=f"Show diffs when committing changes (default: False, ${env_prefix}SHOW_DIFFS)", default=bool(int(os.environ.get(f"{env_prefix}SHOW_DIFFS", 0))), ) >>>>>>> UPDATED ``` Now, you can use the `--no-auto-commits` argument when running the script, and it will also read the `AIDER_NO_AUTO_COMMITS` environment variable to set its default value.
This commit is contained in:
parent
b83ef2f30f
commit
a6d9581e5f
1 changed files with 6 additions and 0 deletions
|
@ -48,6 +48,12 @@ def main():
|
|||
metavar="FILE",
|
||||
help="Apply the changes from the given file instead of running the chat (debug)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no-auto-commits",
|
||||
action="store_true",
|
||||
help=f"Do not automatically commit changes (default: False, ${env_prefix}NO_AUTO_COMMITS)",
|
||||
default=bool(int(os.environ.get(f"{env_prefix}NO_AUTO_COMMITS", 0))),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--show-diffs",
|
||||
action="store_true",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue