Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,7 @@ func TestUsageErrors(t *testing.T) {
{"--endpoint without --transport", []string{"send", "-e", "http://x", "hi"}},
{"--endpoint with two --transport", []string{"send", "-e", "http://x", "--transport", "rest", "--transport", "grpc", "hi"}},
{"empty --transport", []string{"send", "-a", "http://x", "--transport", "", "hi"}},
{"unknown --a2a-version", []string{"send", "-a", "http://x", "--a2a-version", "1", "hi"}},
{"unknown server --protocol", []string{"server", "--echo", "--port", "0", "--protocol", "bogus"}},
{"unknown server --serve-transport", []string{"server", "--echo", "--port", "0", "--serve-transport", "bogus"}},
{"missing server --card file", []string{"server", "--echo", "--port", "0", "--card", "/no/such/card.json"}},
Expand Down
5 changes: 5 additions & 0 deletions internal/cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ func newAgentClient(ctx context.Context, cfg *globalConfig, extraOpts ...a2aclie
if err := cfg.initTLS(); err != nil {
return nil, err
}
switch cfg.a2aVersion {
case "", "1.0", "0.3":
default:
return nil, clierr.Usage(fmt.Sprintf("invalid --a2a-version %q (want 1.0 or 0.3)", cfg.a2aVersion))
}
switch {
case cfg.url != "" && cfg.agentCard.IsSet():
return nil, clierr.Usage("--endpoint and --agent-card are mutually exclusive")
Expand Down
Loading