From 401683a6b11e5a7810c949147a12f2c4bbfba48a Mon Sep 17 00:00:00 2001 From: James O'Doherty Date: Fri, 22 May 2026 10:22:40 -0400 Subject: feat: add argument verification diagnostic and secure temp files for launcher --- internal/cli/cli.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'internal/cli') diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 6118ee5..b315fba 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -18,19 +18,19 @@ func NewApp(args []string) *App { } func (a *App) Run() error { - // 1. Ensure we are in an isolated network namespace - if err := namespace.Bootstrap(); err != nil { - return fmt.Errorf("namespace bootstrap failed: %w", err) - } - - // Handle the internal diagnostic command first - if len(a.Args) > 1 && a.Args[1] == "test-ns" { - ok, msg := namespace.VerifyIsolation() - if !ok { - return fmt.Errorf("isolation check failed: %s", msg) + // Handle the internal diagnostic commands first + if len(a.Args) > 1 { + switch a.Args[1] { + case "test-ns": + ok, msg := namespace.VerifyIsolation() + if !ok { + return fmt.Errorf("isolation check failed: %s", msg) + } + fmt.Println("Isolation Verified: OK") + return nil + case "test-args": + return namespace.VerifyArguments(a.Args) } - fmt.Println("Isolation Verified: OK") - return nil } // Handle subcommands first (profile list, import, configure, delete, stop) -- cgit v1.2.3