Skip to content

prompt_utils

Utils for prompting the user.

confirm_input(question, validator=None)

Confirms the answer from input on a questionary question.

Source code in dapla_team_cli/pr/prompt_utils.py
 8
 9
10
11
12
13
def confirm_input(question: str, validator: Any = None) -> str:
    """Confirms the answer from input on a questionary question."""
    answer = questionary.text(question, validate=validator).ask()
    while not questionary.confirm(f"Are you sure '{answer}' is correct?").ask():
        answer = questionary.text(question).ask()
    return str(answer)