From 064b0d954f5eb16a4089d8dbf6ea56471d558fd7 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 9 Aug 2024 16:34:06 -0300 Subject: [PATCH] feat: Add --read parameter to specify read-only files --- aider/args.py | 6 ++++++ aider/main.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/aider/args.py b/aider/args.py index ff061c4b1..a12998972 100644 --- a/aider/args.py +++ b/aider/args.py @@ -420,6 +420,12 @@ def get_parser(default_config_files, git_root): metavar="FILE", help="specify a file to edit (can be used multiple times)", ) + group.add_argument( + "--read", + action="append", + metavar="FILE", + help="specify a read-only file (can be used multiple times)", + ) group.add_argument( "--vim", action="store_true", diff --git a/aider/main.py b/aider/main.py index a7c3ac808..6cfb44a5c 100644 --- a/aider/main.py +++ b/aider/main.py @@ -384,6 +384,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F all_files = args.files + (args.file or []) fnames = [str(Path(fn).resolve()) for fn in all_files] + read_only_fnames = [str(Path(fn).resolve()) for fn in (args.read or [])] if len(all_files) > 1: good = True for fname in all_files: @@ -501,6 +502,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F io=io, repo=repo, fnames=fnames, + read_only_fnames=read_only_fnames, pretty=args.pretty, show_diffs=args.show_diffs, auto_commits=args.auto_commits,