From 286e684d41c30c73e1effcbbf336fc4ab2894036 Mon Sep 17 00:00:00 2001 From: Andrew Pimenov Date: Sun, 9 Aug 2026 11:28:18 +0300 Subject: [PATCH] cli: remember ndt7 consent in a cache marker so repeat runs stop re-prompting --- src/netcheck/cli.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/netcheck/cli.py b/src/netcheck/cli.py index f8ad7e3..ded8d77 100644 --- a/src/netcheck/cli.py +++ b/src/netcheck/cli.py @@ -448,9 +448,15 @@ def run( tcp_trace=tcp_trace, ) if ndt7: - console.print(f"[yellow]{NDT7_CONSENT_NOTICE}[/yellow]") - if sys.stdin.isatty() and not typer.confirm("Continue with NDT7?", default=False): - options.ndt7 = False + consent_marker = Path(settings.output.cache_dir) / "ndt7_consent" + if not consent_marker.exists(): + console.print(f"[yellow]{NDT7_CONSENT_NOTICE}[/yellow]") + 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 if tcp_trace: console.print( "[yellow]--tcp-trace needs Npcap (Windows) or root (Unix) and the `tcptrace` extra; "