mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
feat: add bulk conversion to read-only mode when no files specified
This commit is contained in:
parent
9974fb50f7
commit
e2385b4922
1 changed files with 6 additions and 1 deletions
|
@ -1210,7 +1210,12 @@ class Commands:
|
|||
def cmd_read_only(self, args):
|
||||
"Add files to the chat that are for reference, not to be edited"
|
||||
if not args.strip():
|
||||
self.io.tool_error("Please provide filenames or directories to read.")
|
||||
# Convert all files in chat to read-only
|
||||
for fname in list(self.coder.abs_fnames):
|
||||
self.coder.abs_fnames.remove(fname)
|
||||
self.coder.abs_read_only_fnames.add(fname)
|
||||
rel_fname = self.coder.get_rel_fname(fname)
|
||||
self.io.tool_output(f"Converted {rel_fname} to read-only")
|
||||
return
|
||||
|
||||
filenames = parse_quoted_filenames(args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue