Return the fallback text in auto mode, otherwise defer to input().
(prompt: str, fallback: str)
| 17 | |
| 18 | |
| 19 | def input_with_fallback(prompt: str, fallback: str) -> str: |
| 20 | """Return the fallback text in auto mode, otherwise defer to input().""" |
| 21 | if is_auto_mode(): |
| 22 | print(f"[auto-input] {prompt.strip()} -> {fallback}") |
| 23 | return fallback |
| 24 | return input(prompt) |
| 25 | |
| 26 | |
| 27 | def confirm_with_fallback(prompt: str, default: bool = True) -> bool: |
no test coverage detected