cli: remember ndt7 consent in a cache marker so repeat runs stop re-prompting

This commit is contained in:
Andrew Pimenov 2026-08-09 11:28:18 +03:00
parent 168cd14f51
commit 286e684d41

View file

@ -448,8 +448,14 @@ def run(
tcp_trace=tcp_trace, tcp_trace=tcp_trace,
) )
if ndt7: if ndt7:
consent_marker = Path(settings.output.cache_dir) / "ndt7_consent"
if not consent_marker.exists():
console.print(f"[yellow]{NDT7_CONSENT_NOTICE}[/yellow]") console.print(f"[yellow]{NDT7_CONSENT_NOTICE}[/yellow]")
if sys.stdin.isatty() and not typer.confirm("Continue with NDT7?", default=False): if sys.stdin.isatty():
if typer.confirm("Continue with NDT7?", default=False):
consent_marker.parent.mkdir(parents=True, exist_ok=True)
consent_marker.write_text("consented\n", encoding="utf-8")
else:
options.ndt7 = False options.ndt7 = False
if tcp_trace: if tcp_trace:
console.print( console.print(