feat(output)!: default list-output changed from yaml to table

This commit is contained in:
Marc Nuri
2025-06-12 15:36:35 +02:00
committed by GitHub
parent 54d3726620
commit 187efaaedc
2 changed files with 4 additions and 4 deletions

View File

@@ -118,7 +118,7 @@ func flagInit() {
rootCmd.Flags().StringP("sse-base-url", "", "", "SSE public base URL to use when sending the endpoint message (e.g. https://example.com)")
rootCmd.Flags().StringP("kubeconfig", "", "", "Path to the kubeconfig file to use for authentication")
rootCmd.Flags().String("profile", "full", "MCP profile to use (one of: "+strings.Join(mcp.ProfileNames, ", ")+")")
rootCmd.Flags().String("list-output", "yaml", "Output format for resource lists (one of: "+strings.Join(output.Names, ", ")+")")
rootCmd.Flags().String("list-output", "table", "Output format for resource lists (one of: "+strings.Join(output.Names, ", ")+")")
rootCmd.Flags().Bool("read-only", false, "If true, only tools annotated with readOnlyHint=true are exposed")
rootCmd.Flags().Bool("disable-destructive", false, "If true, tools annotated with destructiveHint=true are disabled")
_ = viper.BindPFlags(rootCmd.Flags())

View File

@@ -52,13 +52,13 @@ func TestListOutput(t *testing.T) {
t.Fatalf("Expected all available outputs, got %s %v", out, err)
}
})
t.Run("default", func(t *testing.T) {
t.Run("defaults to table", func(t *testing.T) {
rootCmd.SetArgs([]string{"--version", "--log-level=1"})
rootCmd.ResetFlags()
flagInit()
out, err := captureOutput(rootCmd.Execute)
if !strings.Contains(out, "- ListOutput: yaml") {
t.Fatalf("Expected list-output 'yaml', got %s %v", out, err)
if !strings.Contains(out, "- ListOutput: table") {
t.Fatalf("Expected list-output 'table', got %s %v", out, err)
}
})
}