feat(cli): add a json output and tests

This commit is contained in:
2025-11-21 12:59:36 +01:00
parent 30a2e88685
commit 7fca1f78dc
18 changed files with 829 additions and 95 deletions

View File

@@ -172,11 +172,12 @@ func FuzzRunCommandHandler(f *testing.F) {
err := handleRunCommand(cfg, args)
if len(args) > 0 && args[0] == "--help" {
switch {
case len(args) > 0 && args[0] == "--help":
if err != nil {
t.Logf("Help flag should not error, got: %v", err)
}
} else if len(args) > 0 {
case len(args) > 0:
if err == nil {
return
}
@@ -190,7 +191,7 @@ func FuzzRunCommandHandler(f *testing.F) {
if !strings.Contains(errMsg, "unexpected arguments") {
t.Logf("Got error (may be acceptable for server setup): %v", err)
}
} else {
default:
if err != nil && strings.Contains(err.Error(), "unexpected arguments") {
t.Fatalf("Empty args should not trigger 'unexpected arguments' error: %v", err)
}