mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
feat: Add --read parameter to specify read-only files
This commit is contained in:
parent
ee6641f2e7
commit
064b0d954f
2 changed files with 8 additions and 0 deletions
|
@ -420,6 +420,12 @@ def get_parser(default_config_files, git_root):
|
||||||
metavar="FILE",
|
metavar="FILE",
|
||||||
help="specify a file to edit (can be used multiple times)",
|
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(
|
group.add_argument(
|
||||||
"--vim",
|
"--vim",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
|
|
|
@ -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 [])
|
all_files = args.files + (args.file or [])
|
||||||
fnames = [str(Path(fn).resolve()) for fn in all_files]
|
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:
|
if len(all_files) > 1:
|
||||||
good = True
|
good = True
|
||||||
for fname in all_files:
|
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,
|
io=io,
|
||||||
repo=repo,
|
repo=repo,
|
||||||
fnames=fnames,
|
fnames=fnames,
|
||||||
|
read_only_fnames=read_only_fnames,
|
||||||
pretty=args.pretty,
|
pretty=args.pretty,
|
||||||
show_diffs=args.show_diffs,
|
show_diffs=args.show_diffs,
|
||||||
auto_commits=args.auto_commits,
|
auto_commits=args.auto_commits,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue