Share source diagnostic CLI parsing

This commit is contained in:
2026-06-02 18:40:17 +00:00
parent 42fb4aa82a
commit 4b6a0a3b74
4 changed files with 77 additions and 46 deletions

View File

@@ -217,12 +217,24 @@ func TestExecuteValidateArgs(t *testing.T) {
wantCode: exitUsage,
wantStderr: "requires --config",
},
{
name: "bundle without config",
args: []string{"validate", "--bundle", "daily"},
wantCode: exitUsage,
wantStderr: "requires --config",
},
{
name: "config without pipeline",
args: []string{"validate", "--config", "config.yml"},
wantCode: exitUsage,
wantStderr: "requires --pipeline",
},
{
name: "invalid format",
args: []string{"validate", "--format", "xml", validPath},
wantCode: exitUsage,
wantStderr: "format must be text or json",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@@ -343,12 +355,24 @@ func TestExecuteInspectArgs(t *testing.T) {
wantCode: exitUsage,
wantStderr: "requires --config",
},
{
name: "bundle without config",
args: []string{"inspect", "--bundle", "daily"},
wantCode: exitUsage,
wantStderr: "requires --config",
},
{
name: "config without pipeline",
args: []string{"inspect", "--config", "config.yml"},
wantCode: exitUsage,
wantStderr: "requires --pipeline",
},
{
name: "invalid format",
args: []string{"inspect", "--format", "xml", validPath},
wantCode: exitUsage,
wantStderr: "format must be text or json",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {