MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / prompt_confirm

Function prompt_confirm

unity_cli/hub/interactive.py:66–86  ·  view source on GitHub ↗

Prompt user for yes/no confirmation. Args: message: The confirmation message. default: Default value if user just presses Enter. Returns: True if confirmed, False otherwise. Returns default if not in TTY or InquirerPy not available.

(message: str, default: bool = False)

Source from the content-addressed store, hash-verified

64
65
66def prompt_confirm(message: str, default: bool = False) -> bool:
67 """Prompt user for yes/no confirmation.
68
69 Args:
70 message: The confirmation message.
71 default: Default value if user just presses Enter.
72
73 Returns:
74 True if confirmed, False otherwise.
75 Returns default if not in TTY or InquirerPy not available.
76 """
77 if not is_tty():
78 return default
79
80 if not _has_inquirerpy():
81 return default
82
83 from InquirerPy import inquirer
84
85 result: bool = inquirer.confirm(message=message, default=default).execute()
86 return result

Callers

nothing calls this directly

Calls 3

is_ttyFunction · 0.85
_has_inquirerpyFunction · 0.85
executeMethod · 0.80

Tested by

no test coverage detected