mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
added --apply arg
This commit is contained in:
parent
8ac27839df
commit
943a789874
1 changed files with 12 additions and 2 deletions
12
coder.py
12
coder.py
|
@ -179,7 +179,7 @@ class Coder:
|
|||
messages += self.get_files_messages()
|
||||
messages += self.cur_messages
|
||||
|
||||
self.show_messages(messages, "all")
|
||||
# self.show_messages(messages, "all")
|
||||
|
||||
content, interrupted = self.send(messages)
|
||||
if interrupted:
|
||||
|
@ -416,6 +416,11 @@ def main():
|
|||
default=True,
|
||||
help="Disable prettyd output of GPT responses",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--apply",
|
||||
metavar="FILE",
|
||||
help="Apply the changes from the given file instead of running the chat",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
@ -424,6 +429,11 @@ def main():
|
|||
pretty = args.pretty
|
||||
|
||||
coder = Coder(use_gpt_4, fnames, pretty)
|
||||
if args.apply:
|
||||
with open(args.apply, "r") as f:
|
||||
content = f.read()
|
||||
coder.update_files(content, inp="")
|
||||
else:
|
||||
coder.run()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue