mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54:59 +00:00
Merge branch 'main' into openai-upgrade
This commit is contained in:
commit
922a56b194
2 changed files with 41 additions and 0 deletions
|
@ -377,6 +377,12 @@ def main(argv=None, input=None, output=None, force_git_root=None):
|
|||
metavar="COMMAND",
|
||||
help="Specify a single message to send GPT, process reply then exit (disables chat mode)",
|
||||
)
|
||||
other_group.add_argument(
|
||||
"--message-file",
|
||||
"-f",
|
||||
metavar="MESSAGE_FILE",
|
||||
help="Specify a file containing the message to send GPT, process reply, then exit (disables chat mode)",
|
||||
)
|
||||
other_group.add_argument(
|
||||
"--encoding",
|
||||
default="utf-8",
|
||||
|
@ -568,8 +574,20 @@ def main(argv=None, input=None, output=None, force_git_root=None):
|
|||
io.tool_error(f"Git working dir: {git_root}")
|
||||
|
||||
if args.message:
|
||||
io.add_to_input_history(args.message)
|
||||
io.tool_output()
|
||||
coder.run(with_message=args.message)
|
||||
elif args.message_file:
|
||||
try:
|
||||
message_from_file = io.read_text(args.message_file)
|
||||
io.tool_output()
|
||||
coder.run(with_message=message_from_file)
|
||||
except FileNotFoundError:
|
||||
io.tool_error(f"Message file not found: {args.message_file}")
|
||||
return 1
|
||||
except IOError as e:
|
||||
io.tool_error(f"Error reading message file: {e}")
|
||||
return 1
|
||||
else:
|
||||
coder.run()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue