{"record":{"id":"c2a0a6b923743944","repo":"hashicorp/packer","slug":"expected-one-of-q","errorCode":null,"errorMessage":"expected one of %q","messagePattern":"expected one of %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/enumflag/flag.go","lineNumber":30,"sourceCode":"\n// New returns a flag.Value implementation for parsing flags with a one-of-a-set value\nfunc New(target *string, options ...string) *enumFlag {\n\treturn &enumFlag{target: target, options: options}\n}\n\nfunc (f *enumFlag) String() string {\n\treturn *f.target\n}\n\nfunc (f *enumFlag) Set(value string) error {\n\tfor _, v := range f.options {\n\t\tif v == value {\n\t\t\t*f.target = value\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"expected one of %q\", f.options)\n}\n","sourceCodeStart":12,"sourceCodeEnd":32,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/command/enumflag/flag.go#L12-L32","documentation":"CLI flag parsing error from enumFlag.Set: the value passed to a one-of-a-set flag (e.g. a log level or format selector) does not match any of the allowed options enumerated in the error. Returned when Set fails to find the value among f.options.","triggerScenarios":"Thrown at command/enumflag/flag.go:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the command with one of the values listed in %q, e.g. the exact allowed flag values","Check the command's help output for the flag's accepted values"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}