{"record":{"id":"51aefca913f67560","repo":"hashicorp/nomad","slug":"invalid-value-for-out-valid-values-are-go-tem-51aefc","errorCode":null,"errorMessage":"Invalid value for \"-out\"; valid values are [go-template, json, table, terse]","messagePattern":"Invalid value for \"-out\"; valid values are \\[go-template, json, table, terse\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/var_list.go","lineNumber":303,"sourceCode":"\t}\n\n\treturn pList\n}\n\nfunc (c *VarListCommand) validateOutputFlag() error {\n\tif c.outFmt != \"go-template\" && c.tmpl != \"\" {\n\t\treturn errors.New(errUnexpectedTemplate)\n\t}\n\tswitch c.outFmt {\n\tcase \"json\", \"terse\", \"table\":\n\t\treturn nil\n\tcase \"go-template\":\n\t\tif c.tmpl == \"\" {\n\t\t\treturn errors.New(errMissingTemplate)\n\t\t}\n\t\treturn nil\n\tdefault:\n\t\treturn errors.New(errInvalidListOutFormat)\n\t}\n}\n","sourceCodeStart":285,"sourceCodeEnd":306,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/var_list.go#L285-L306","documentation":"VarListCommand.validateOutputFlag checks -output against the list-specific allowlist (go-template, json, terse, table). Unknown values hit the default case and return this error, which differs from the get command's allowlist (no hcl/none).","triggerScenarios":"Running `vault kv list -output=hcl|none|yaml <path>` — formats valid for `kv get` but not `kv list` — or any misspelling.","commonSituations":"Copy-pasting -output=hcl or -output=none from a `kv get` command into `kv list`; typos in scripts; case mismatches like -output=JSON.","solutions":["Use one of: go-template, json, table, terse (lowercase)","Do not reuse the kv get format list for kv list; fix the value","Render to another format by piping json through jq/yq"],"exampleFix":"// before\nvault kv list -output=hcl secret/\n// after\nvault kv list -output=json secret/ | jq .","handlingStrategy":"validation","validationCode":"switch outFmt {\ncase \"go-template\", \"json\", \"table\", \"terse\":\n\t// ok\ndefault:\n\treturn fmt.Errorf(\"invalid -out %q; must be one of go-template,json,table,terse\", outFmt)\n}","typeGuard":null,"tryCatchPattern":"if err := cmd.validateOutputFlag(); err != nil {\n\tif strings.Contains(err.Error(), \"Invalid value for \\\"-out\\\"\") {\n\t\t// map unsupported formats (hcl/none) to json and retry\n\t}\n\treturn err\n}","preventionTips":["Do not share the kv get format allowlist with kv list","Use shell completion for valid values","Normalize case before passing -output"],"tags":["go","cli","flags","validation"],"backgroundTag":"invalid-flag-value","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}