{"record":{"id":"ea09fedcfd2cc020","repo":"kovidgoyal/kitty","slug":"unknown-fit-specification-v","errorCode":null,"errorMessage":"unknown fit specification: %#v","messagePattern":"unknown fit specification: %#v","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/icat/main.go","lineNumber":113,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"Invalid value for --z-index with error: %w\", err)\n\t}\n\tz_index = int32(i) + origin\n\treturn\n}\n\nfunc parse_fit() (err error) {\n\tswitch strings.ToLower(opts.Fit) {\n\tcase \"width\":\n\t\tfit_mode = fit_width\n\tcase \"height\":\n\t\tfit_mode = fit_height\n\tcase \"none\", \"neither\":\n\t\tfit_mode = fit_none\n\tcase \"both\":\n\t\tfit_mode = fit_both\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown fit specification: %#v\", opts.Fit)\n\t}\n\treturn nil\n}\n\nfunc parse_place() (err error) {\n\tif opts.Place == \"\" {\n\t\treturn nil\n\t}\n\tarea, pos, found := strings.Cut(opts.Place, \"@\")\n\tif !found {\n\t\treturn fmt.Errorf(\"Invalid --place specification: %s\", opts.Place)\n\t}\n\tw, h, found := strings.Cut(area, \"x\")\n\tif !found {\n\t\treturn fmt.Errorf(\"Invalid --place specification: %s\", opts.Place)\n\t}\n\tl, t, found := strings.Cut(pos, \"x\")\n\tif !found {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/icat/main.go#L95-L131","documentation":"--fit must be one of the recognized keywords (scale, height/xx, none/neither, both); anything else hits the default case.","triggerScenarios":"--fit=fill, --fit=width, or a typo like --fit=boths.","commonSituations":"Assuming CSS-like object-fit values (fill, contain) or guessing 'width' which isn't supported.","solutions":["Use a supported keyword: scale (default), height, none/neither, or both","Check kitty docs for the icat --fit option in your version"],"exampleFix":"# before\nkitty +kitten icat --fit=contain img.png\n# after\nkitty +kitten icat --fit=both img.png","handlingStrategy":"type-guard","validationCode":"var validFit = map[string]bool{\"scale\":true,\"height\":true,\"xx\":true,\"none\":true,\"neither\":true,\"both\":true}","typeGuard":"func isValidFit(s string) bool { switch s { case \"scale\",\"height\",\"xx\",\"none\",\"neither\",\"both\": return true }; return false }","tryCatchPattern":null,"preventionTips":["Whitelist fit keywords at the CLI wrapper","Keep docs handy for supported keywords"],"tags":["kitty","icat","fit","argument-validation"],"backgroundTag":"invalid-enum-argument","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}