mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 19:24:59 +00:00
fix: Add ConfirmGroup to confirm URL addition
This commit is contained in:
parent
47294e7609
commit
b26550d93f
2 changed files with 10 additions and 4 deletions
|
@ -30,8 +30,9 @@ class ConfirmGroup:
|
|||
preference: str = None
|
||||
show_group: bool = True
|
||||
|
||||
def __init__(self, items):
|
||||
self.show_group = len(items) > 1
|
||||
def __init__(self, items=None):
|
||||
if items is not None:
|
||||
self.show_group = len(items) > 1
|
||||
|
||||
|
||||
class AutoCompleter(Completer):
|
||||
|
@ -383,6 +384,9 @@ class InputOutput:
|
|||
):
|
||||
self.num_user_asks += 1
|
||||
|
||||
if group and not group.show_group:
|
||||
group = None
|
||||
|
||||
valid_responses = "yn"
|
||||
options = " (Y)es/(N)o"
|
||||
if group:
|
||||
|
@ -427,6 +431,7 @@ class InputOutput:
|
|||
res = "n"
|
||||
elif group and group.preference:
|
||||
res = group.preference
|
||||
self.user_input(f"{question}{res}", log_only=False)
|
||||
else:
|
||||
res = prompt(
|
||||
question,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue