mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
fix: Exclude "All" option and don't honor group preference when explicit_yes_required is True
This commit is contained in:
parent
6aae2bc794
commit
2643cc8643
1 changed files with 11 additions and 6 deletions
17
aider/io.py
17
aider/io.py
|
@ -379,7 +379,10 @@ class InputOutput:
|
||||||
):
|
):
|
||||||
self.num_user_asks += 1
|
self.num_user_asks += 1
|
||||||
|
|
||||||
question += " (Y)es/(N)o/(A)ll/(S)kip all [Y]: "
|
if explicit_yes_required:
|
||||||
|
question += " (Y)es/(N)o/(S)kip all [Y]: "
|
||||||
|
else:
|
||||||
|
question += " (Y)es/(N)o/(A)ll/(S)kip all [Y]: "
|
||||||
|
|
||||||
if subject:
|
if subject:
|
||||||
self.tool_output()
|
self.tool_output()
|
||||||
|
@ -398,11 +401,13 @@ class InputOutput:
|
||||||
style = dict()
|
style = dict()
|
||||||
|
|
||||||
def is_valid_response(text):
|
def is_valid_response(text):
|
||||||
return text.lower()[0] in ["y", "n", "a", "s", ""]
|
valid_responses = ["y", "n", "s", ""] if explicit_yes_required else ["y", "n", "a", "s", ""]
|
||||||
|
return text.lower()[0] in valid_responses
|
||||||
|
|
||||||
|
error_message = "Please answer Yes, No, or Skip all." if explicit_yes_required else "Please answer Yes, No, All, or Skip all."
|
||||||
validator = Validator.from_callable(
|
validator = Validator.from_callable(
|
||||||
is_valid_response,
|
is_valid_response,
|
||||||
error_message="Please answer Yes, No, All, or Skip all.",
|
error_message=error_message,
|
||||||
move_cursor_to_end=True,
|
move_cursor_to_end=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -410,7 +415,7 @@ 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:
|
elif group and group.preference and not explicit_yes_required:
|
||||||
res = group.preference
|
res = group.preference
|
||||||
else:
|
else:
|
||||||
res = prompt(
|
res = prompt(
|
||||||
|
@ -423,10 +428,10 @@ class InputOutput:
|
||||||
|
|
||||||
res = res.lower()[0]
|
res = res.lower()[0]
|
||||||
is_yes = res in ("y", "a")
|
is_yes = res in ("y", "a")
|
||||||
is_all = res == "a"
|
is_all = res == "a" and not explicit_yes_required
|
||||||
is_skip = res == "s"
|
is_skip = res == "s"
|
||||||
|
|
||||||
if group:
|
if group and not explicit_yes_required:
|
||||||
if is_all:
|
if is_all:
|
||||||
group.preference = "a"
|
group.preference = "a"
|
||||||
elif is_skip:
|
elif is_skip:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue