{"record":{"id":"27061f5ff47d2539","repo":"larksuite/cli","slug":"invalid-value-q-for-s-allowed-s","errorCode":null,"errorMessage":"invalid value %q for --%s, allowed: %s","messagePattern":"invalid value %q for --(.+?), allowed: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/sheets/flag_view.go","lineNumber":364,"sourceCode":"\t\t}\n\t\tif value == \"\" || slices.Contains(df.Enum, value) {\n\t\t\tcontinue\n\t\t}\n\t\tif canonical := canonicalEnumValue(value, df.Enum); canonical != \"\" {\n\t\t\tm.raw[rawKey] = canonical\n\t\t\tcontinue\n\t\t}\n\t\t// A retired value means \"as if omitted\" — delete the key so Changed()\n\t\t// also reports it as absent, matching the standalone path.\n\t\tif isRetiredEnumValue(m.command, df.Name, value) {\n\t\t\tdelete(m.raw, rawKey)\n\t\t\tcontinue\n\t\t}\n\t\tmessage := fmt.Sprintf(\"invalid value %q for --%s, allowed: %s\", value, df.Name, strings.Join(df.Enum, \", \"))\n\t\tif match := closestEnumValue(value, df.Enum); match != \"\" {\n\t\t\tmessage += fmt.Sprintf(\"; did you mean %q?\", match)\n\t\t}\n\t\treturn fmt.Errorf(\"%s\", message) //nolint:forbidigo // intermediate error; batch dispatcher adds typed operations context\n\t}\n\treturn nil\n}\n\n// normalizeRangeSheetPrefix mirrors the standalone chainRangeSheetPrefix\n// rewrite (range_sheet_prefix.go) for the map-backed paths, +batch-update\n// sub-ops and +cells-set --writes items: one that named its sheet only inside\n// \"range\" (\"Sheet1!A1:D20\") gets sheet_name filled in and the bare range left\n// behind, so every form accepts the same input.\n//\n// The derived selector is written under the underscore key the sub-op input\n// vocabulary uses, and left as the only spelling of it; lookupRaw is\n// separator-tolerant, so a translator asking for \"sheet-name\" finds it anyway.\nfunc (m *mapFlagView) normalizeRangeSheetPrefix() {\n\tif !rangeSheetPrefixApplies(m.command) {\n\t\treturn\n\t}\n\tif strings.TrimSpace(m.Str(\"sheet-id\")) != \"\" || strings.TrimSpace(m.Str(\"sheet-name\")) != \"\" {","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/sheets/flag_view.go#L346-L382","documentation":"Enum normalization for batch ops: the string value is not in the embedded flag-defs enum, not a case-insensitive canonical match, and not a retired value (which would be dropped as if omitted); the message may append a closest-match suggestion.","triggerScenarios":"Thrown at shortcuts/sheets/flag_view.go:364 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the allowed enum values listed in the message, or the suggested closest match"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}