{"record":{"id":"3eae06fb214eb63b","repo":"argoproj/argo-workflows","slug":"unknown-output-mode-s","errorCode":null,"errorMessage":"unknown output mode: %s","messagePattern":"unknown output mode: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/clustertemplate/list.go","lineNumber":54,"sourceCode":"\t\t\t}\n\t\t\tserviceClient, err := apiClient.NewClusterWorkflowTemplateServiceClient()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tcwftmplList, err := serviceClient.ListClusterWorkflowTemplates(ctx, &clusterworkflowtemplate.ClusterWorkflowTemplateListRequest{})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tswitch output.String() {\n\t\t\tcase \"\", \"wide\":\n\t\t\t\tprintTable(cwftmplList.Items)\n\t\t\tcase \"name\":\n\t\t\t\tfor _, cwftmp := range cwftmplList.Items {\n\t\t\t\t\tfmt.Println(cwftmp.Name)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"unknown output mode: %s\", output.String())\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\tcommand.Flags().VarP(&output, \"output\", \"o\", \"Output format. \"+output.Usage())\n\treturn command\n}\n\nfunc printTable(wfList []wfv1.ClusterWorkflowTemplate) {\n\tw := tabwriter.NewWriter(os.Stdout, 0, 0, 3, ' ', 0)\n\t_, _ = fmt.Fprint(w, \"NAME\")\n\t_, _ = fmt.Fprint(w, \"\\n\")\n\tfor _, wf := range wfList {\n\t\t_, _ = fmt.Fprintf(w, \"%s\\t\", wf.Name)\n\t\t_, _ = fmt.Fprintf(w, \"\\n\")\n\t}\n\t_ = w.Flush()\n}","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/clustertemplate/list.go#L36-L72","documentation":"`argo cluster-template list` validates its `--output`/`-o` flag against the EnumFlagValue whitelist {wide, name} after listing ClusterWorkflowTemplates from the argo server. If the resolved output string is not an accepted value, the switch falls to default and returns this error. The flag is an EnumFlagValue, so this normally means the value bypassed flag validation (e.g. set programmatically) or the empty/generic default branch was hit with an unexpected string.","triggerScenarios":"Running `argo cluster-template list -o <value>` where <value> is anything other than \"\", \"wide\", or \"name\" — e.g. `-o json`, `-o yaml`, `-o table`, which are valid for other argo commands but not this one.","commonSituations":"Scripts or shell aliases copying the `-o json`/`-o yaml` idiom from `argo list`, `argo template list`, or kubectl; muscle-memory reuse of kubectl output formats against the cluster-template command.","solutions":["Use an allowed output value: omit `-o` (default/wide table) or pass `-o wide` or `-o name","Get machine-readable output via the API/CLI alternatives (e.g. `argo cluster-template list -o name` plus per-template gets, or use the gRPC/HTTP API directly) since json/yaml output is not supported by this command","Run `argo cluster-template list --help` to see the documented values in the -o flag usage"],"exampleFix":"// before\nargo cluster-template list -o json\n// after\nargo cluster-template list -o name   # or: argo cluster-template list -o wide","handlingStrategy":"validation","validationCode":"case \"\", \"wide\", \"name\": // ok\ndefault:\n  echo \"invalid -o '$o'; allowed: wide, name\" >&2; exit 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pass -o wide or -o name to cluster-template list; reserve -o json/yaml for commands that support them","Check `argo cluster-template list --help` before scripting the flag","Wrap argo CLI calls in CI with a flag whitelist lint script"],"tags":["cli","cli-flags","argoproj"],"backgroundTag":"invalid-flag-value","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}