{"record":{"id":"85fb2e30871dbdcf","repo":"junegunn/fzf","slug":"invalid-wrap-mode-s-expected-char-or-word","errorCode":null,"errorMessage":"invalid wrap mode: %s (expected: char or word)","messagePattern":"invalid wrap mode: (.+?) \\(expected: char or word\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":2947,"sourceCode":"\t\t\topts.Cycle = true\n\t\tcase \"--highlight-line\":\n\t\t\topts.CursorLine = true\n\t\tcase \"--no-highlight-line\":\n\t\t\topts.CursorLine = false\n\t\tcase \"--no-cycle\":\n\t\t\topts.Cycle = false\n\t\tcase \"--wrap\":\n\t\t\tgiven, str := optionalNextString()\n\t\t\tif given {\n\t\t\t\tswitch str {\n\t\t\t\tcase \"char\":\n\t\t\t\t\topts.Wrap = true\n\t\t\t\t\topts.WrapWord = false\n\t\t\t\tcase \"word\":\n\t\t\t\t\topts.Wrap = true\n\t\t\t\t\topts.WrapWord = true\n\t\t\t\tdefault:\n\t\t\t\t\treturn errors.New(\"invalid wrap mode: \" + str + \" (expected: char or word)\")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\topts.Wrap = true\n\t\t\t}\n\t\tcase \"--no-wrap\":\n\t\t\topts.Wrap = false\n\t\t\topts.WrapWord = false\n\t\tcase \"--wrap-word\":\n\t\t\topts.Wrap = true\n\t\t\topts.WrapWord = true\n\t\tcase \"--no-wrap-word\":\n\t\t\topts.WrapWord = false\n\t\tcase \"--wrap-sign\":\n\t\t\tstr, err := nextString(\"wrap sign required\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\topts.WrapSign = &str","sourceCodeStart":2929,"sourceCodeEnd":2965,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L2929-L2965","documentation":"Thrown when --wrap is given an explicit argument that is not 'char' or 'word'. --wrap alone enables character wrapping; --wrap word enables word wrapping; any other string (including empty or misspelled values) is rejected. Note --wrap-word exists as a separate option.","triggerScenarios":"`--wrap line`, `--wrap chars` (plural), `--wrap ''` via an optional-argument quirk, or a variable expanding to something unexpected.","commonSituations":"Assuming 'line' or 'lines' is valid vocabulary; scripts passing WRAP_MODE variables that are empty or mis-set; fzf versions where --wrap itself is unavailable (then the option is unknown outright).","solutions":["Use `--wrap` alone, `--wrap char`, `--wrap word`, or `--wrap-word`","Check the variable feeding --wrap: must be unset/empty-free and exactly 'char' or 'word'","Upgrade fzf if --wrap is not recognized at all (added in 0.48+)"],"exampleFix":"# before\nfzf --wrap line\n# after\nfzf --wrap word","handlingStrategy":"type-guard","validationCode":"# bash\n[[ \"$WRAP\" =~ ^(char|word)$ ]] || WRAP=\"\"\n[ -n \"$WRAP\" ] && fzf --wrap \"$WRAP\" || fzf --wrap","typeGuard":"wrap_mode_ok() { case \"$1\" in char|word) return 0;; *) return 1;; esac; }","tryCatchPattern":null,"preventionTips":["Whitelist wrap mode values to char|word before forwarding","Use --wrap-word directly for word mode instead of --wrap word"],"tags":["fzf","go","cli","ui","wrap","validation"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}