{"record":{"id":"0763b4558cfd0d65","repo":"junegunn/fzf","slug":"unknown-option-s","errorCode":null,"errorMessage":"unknown option: %s","messagePattern":"unknown option: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":3498,"sourceCode":"\t\tdefault:\n\t\t\tif match, value := optString(arg, \"-q\"); match {\n\t\t\t\topts.Query = value\n\t\t\t} else if match, value := optString(arg, \"-f\"); match {\n\t\t\t\topts.Filter = &value\n\t\t\t} else if match, value := optString(arg, \"-d\"); match {\n\t\t\t\topts.Delimiter = delimiterRegexp(value)\n\t\t\t} else if match, value := optString(arg, \"-n\"); match {\n\t\t\t\tif opts.Nth, err = splitNth(value); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else if match, _ := optString(arg, \"-s\"); match {\n\t\t\t\topts.Sort = 1 // Don't care\n\t\t\t} else if match, value := optString(arg, \"-m\"); match {\n\t\t\t\tif opts.Multi, err = atoi(value); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn errors.New(\"unknown option: \" + arg)\n\t\t\t}\n\t\t}\n\n\t\tif val != nil {\n\t\t\treturn errors.New(\"unexpected value for \" + arg + \": \" + *val)\n\t\t}\n\t}\n\t*index += len(allArgs)\n\n\tif opts.HeaderLines < 0 {\n\t\treturn errors.New(\"header lines must be a non-negative integer\")\n\t}\n\n\tif opts.HscrollOff < 0 {\n\t\treturn errors.New(\"hscroll offset must be a non-negative integer\")\n\t}\n\n\tif opts.ScrollOff < 0 {","sourceCodeStart":3480,"sourceCodeEnd":3516,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L3480-L3516","documentation":"The given argument did not match any known option in this parsing branch. This block handles the small/short option chain (-n, -s, -m, delimiter, etc.); when an argument matches none of the recognized forms, fzf reports it as an unknown option instead of silently ignoring it.","triggerScenarios":"Passing an unrecognized short option or a misspelled flag to fzf, e.g. -x, -sort, or -N (uppercase). Each else-if attempts optString(arg, ...) for known short options; falling through all of them reaches errors.New(\"unknown option: \" + arg) at options.go:3498.","commonSituations":"Typos in short flags; using flags from a different tool's muscle memory (grep/awk style); passing combined short options like -sm which fzf does not support in this form; version differences where an option was renamed.","solutions":["Check spelling of the option against fzf --help","Use the long form of the option (e.g. --multi instead of -m) which gives clearer errors","Pass each short option separately rather than bundling them","Upgrade fzf if the option was added in a newer version"],"exampleFix":"# before\nfzf -sort\n# after\nfzf --sort","handlingStrategy":"validation","validationCode":"// Shell: reject unknown short flags before calling fzf\nknown='d D e m N n s x q t Q + --'\nfor a in \"$@\"; do\n  case \"$a\" in -*) [[ $known == *\"${a%%=*}\"* ]] || { echo \"unsupported flag: $a\" >&2; exit 2; } ;; esac\ndone\nexec fzf \"$@\"","typeGuard":null,"tryCatchPattern":"Capture fzf's stderr; on 'unknown option:', echo the offending token and suggest `fzf --help` in your wrapper's error path.","preventionTips":["Prefer long option names (--multi, --sort) for clarity and stability","Pin the fzf version in CI so option sets don't drift","Add a smoke test that runs your wrapper with --help and greps for the flags you use"],"tags":["fzf","cli","option-parsing"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}