mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
feat: Add group parameter to confirm_ask function
This commit is contained in:
parent
16c1d21bc0
commit
1be65f9c77
1 changed files with 9 additions and 1 deletions
10
aider/io.py
10
aider/io.py
|
@ -376,7 +376,7 @@ class InputOutput:
|
||||||
hist = "\n" + content.strip() + "\n\n"
|
hist = "\n" + content.strip() + "\n\n"
|
||||||
self.append_chat_history(hist)
|
self.append_chat_history(hist)
|
||||||
|
|
||||||
def confirm_ask(self, question, default="y", subject=None, explicit_yes_required=False):
|
def confirm_ask(self, question, default="y", subject=None, explicit_yes_required=False, group=None):
|
||||||
self.num_user_asks += 1
|
self.num_user_asks += 1
|
||||||
|
|
||||||
question += " (Y)es/(N)o/(A)ll/(S)kip all [Y]: "
|
question += " (Y)es/(N)o/(A)ll/(S)kip all [Y]: "
|
||||||
|
@ -410,6 +410,8 @@ class InputOutput:
|
||||||
res = "n" if explicit_yes_required else "y"
|
res = "n" if explicit_yes_required else "y"
|
||||||
elif self.yes is False:
|
elif self.yes is False:
|
||||||
res = "n"
|
res = "n"
|
||||||
|
elif group and group.preference:
|
||||||
|
res = group.preference
|
||||||
else:
|
else:
|
||||||
res = prompt(
|
res = prompt(
|
||||||
question,
|
question,
|
||||||
|
@ -424,6 +426,12 @@ class InputOutput:
|
||||||
is_all = res == "a"
|
is_all = res == "a"
|
||||||
is_skip = res == "s"
|
is_skip = res == "s"
|
||||||
|
|
||||||
|
if group:
|
||||||
|
if is_all:
|
||||||
|
group.preference = "a"
|
||||||
|
elif is_skip:
|
||||||
|
group.preference = "s"
|
||||||
|
|
||||||
hist = f"{question.strip()} {res}"
|
hist = f"{question.strip()} {res}"
|
||||||
self.append_chat_history(hist, linebreak=True, blockquote=True)
|
self.append_chat_history(hist, linebreak=True, blockquote=True)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue