{"record":{"id":"4d00514caeb73fff","repo":"argoproj/argo-workflows","slug":"e-usage","errorCode":null,"errorMessage":"${e.Usage()}","messagePattern":"\\$\\{e\\.Usage\\(\\)\\}","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/common/flags.go","lineNumber":33,"sourceCode":"type EnumFlagValue struct {\n\tAllowedValues []string\n\tValue         string\n}\n\nfunc (e *EnumFlagValue) Usage() string {\n\treturn fmt.Sprintf(\"One of: %s\", strings.Join(e.AllowedValues, \"|\"))\n}\n\nfunc (e *EnumFlagValue) String() string {\n\treturn e.Value\n}\n\nfunc (e *EnumFlagValue) Set(v string) error {\n\tif slices.Contains(e.AllowedValues, v) {\n\t\te.Value = v\n\t\treturn nil\n\t}\n\treturn errors.New(e.Usage())\n}\n\nfunc (e *EnumFlagValue) Type() string {\n\treturn \"string\"\n}\n\nvar _ pflag.Value = &EnumFlagValue{}\n\nfunc NewPrintWorkflowOutputValue(value string) EnumFlagValue {\n\treturn EnumFlagValue{\n\t\tAllowedValues: []string{\"name\", \"json\", \"yaml\", \"wide\"},\n\t\tValue:         value,\n\t}\n}\n","sourceCodeStart":15,"sourceCodeEnd":48,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/common/flags.go#L15-L48","documentation":"Returned by EnumFlagValue.Set when the user passes a CLI flag value that is not one of the enum's AllowedValues (e.g. --output for get/list commands). The text of the error is the generated usage line listing the allowed choices.","triggerScenarios":"Passing a value not in the enum to any flag backed by EnumFlagValue, e.g. --logformat with a typo, or an invalid --gloglevel, or unknown output format.","commonSituations":"Typos like --output yamlx; case mismatches (JSON vs json); deprecated values removed in newer CLI versions; scripts carrying flags from older releases.","solutions":["Read the usage text in the error and pick one of the listed allowed values.","Fix casing/typos (values are matched exactly).","Run argo <cmd> --help to see the current accepted values for your version."],"exampleFix":"// before\nargo list --output yamlx\n// after\nargo list --output yaml","handlingStrategy":"validation","validationCode":"ALLOWED=(\"json\" \"yaml\" \"wide\" \"name\")\nif [[ ! \" ${ALLOWED[*]} \" == *\" $FMT \"* ]]; then echo \"bad --output: $FMT\"; exit 1; fi","typeGuard":null,"tryCatchPattern":"out=$(argo list --output \"$FMT\" 2>&1) || {\n  echo \"$out\" # usage text lists allowed values\n}","preventionTips":["Copy flag values from --help output, not memory.","Quote and lowercase enum values consistently in scripts.","Pin CLI version in scripts so accepted values don't drift."],"tags":["cli","flags","validation"],"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-08T10:18:20.063Z"}