From aadcf413e5b4251237a63c3958f60acab381c020 Mon Sep 17 00:00:00 2001 From: dataCenter430 Date: Tue, 7 Apr 2026 15:49:31 +0200 Subject: [PATCH] fix: address review --- cmd/picoclaw/internal/cliui/cliui_test.go | 7 +++++-- cmd/picoclaw/internal/cliui/help_error.go | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/picoclaw/internal/cliui/cliui_test.go b/cmd/picoclaw/internal/cliui/cliui_test.go index 732d4b1e9..c07e220ee 100644 --- a/cmd/picoclaw/internal/cliui/cliui_test.go +++ b/cmd/picoclaw/internal/cliui/cliui_test.go @@ -27,12 +27,15 @@ func TestShowErrHint(t *testing.T) { {"required flag(s) \"model\" not set", true}, // Generic invalid-argument errors — should show hint {"invalid argument \"abc\" for --count", true}, + // required flag errors — should show hint + {"required flag(s) \"model\" not set", true}, // usage: in message — should show hint {"bad input\nusage: picoclaw ...", true}, - // Should NOT false-positive on unrelated "flag" words + // Should NOT false-positive on broad words {"connection flagged by remote", false}, {"feature flag not set", false}, - {"please flag this issue", false}, + {"invalid API key provided", false}, + {"authentication required", false}, // Unrelated messages — no hint {"something went wrong", false}, {"network timeout", false}, diff --git a/cmd/picoclaw/internal/cliui/help_error.go b/cmd/picoclaw/internal/cliui/help_error.go index 7972f91d3..1e859b08f 100644 --- a/cmd/picoclaw/internal/cliui/help_error.go +++ b/cmd/picoclaw/internal/cliui/help_error.go @@ -69,7 +69,7 @@ func showErrHint(msg string) bool { return strings.Contains(m, "unknown flag") || strings.Contains(m, "unknown shorthand flag") || strings.Contains(m, "flag needs an argument") || - strings.Contains(m, "invalid") || - strings.Contains(m, "required") || + strings.Contains(m, "invalid argument") || + strings.Contains(m, "required flag") || strings.Contains(m, "usage:") }