{"record":{"id":"f2a20728eaadee61","repo":"kovidgoyal/kitty","slug":"failed-to-parse-rg-help-output-could-not-find-any","errorCode":null,"errorMessage":"Failed to parse rg help output, could not find any options","messagePattern":"Failed to parse rg help output, could not find any options","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/hyperlinked_grep/main.go","lineNumber":79,"sourceCode":"\t\t\t\t\terr = fmt.Errorf(\"Failed to parse rg help output line: %s\", line)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tfor _, x := range single_letter_aliases {\n\t\t\t\t\talias_map[x] = long_option_names[0]\n\t\t\t\t}\n\t\t\t\tfor _, x := range long_option_names[1:] {\n\t\t\t\t\talias_map[x] = long_option_names[0]\n\t\t\t\t}\n\t\t\t\texpecting_args[long_option_names[0]] = expecting_arg\n\t\t\t}\n\t\t} else {\n\t\t\tif strings.HasSuffix(line, \"OPTIONS:\") {\n\t\t\t\toptions_started = true\n\t\t\t}\n\t\t}\n\t}\n\tif len(expecting_args) == 0 || len(alias_map) == 0 {\n\t\terr = fmt.Errorf(\"Failed to parse rg help output, could not find any options\")\n\t\treturn\n\t}\n\treturn\n}\n\ntype kitten_options struct {\n\tmatching_lines, context_lines, file_headers    bool\n\twith_filename, heading, line_number            bool\n\tstats, count, count_matches                    bool\n\tfiles, files_with_matches, files_without_match bool\n\tvimgrep                                        bool\n}\n\nfunc default_kitten_opts() *kitten_options {\n\treturn &kitten_options{\n\t\tmatching_lines: true, context_lines: true, file_headers: true,\n\t\twith_filename: true, heading: true, line_number: true,\n\t}","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/hyperlinked_grep/main.go#L61-L97","documentation":"After scanning all of `rg --help`, the parser collected no options or no alias mappings at all — the OPTIONS section was never found or matched nothing. This is the wholesale failure counterpart to the per-line error.","triggerScenarios":"rg --help output lacking a line ending in 'OPTIONS:' (major help-format change), empty output, or a non-ripgrep binary responding differently.","commonSituations":"rg replaced by an alias/wrapper (e.g. a shell function or a different tool); extremely old/new ripgrep with different help layout; truncated output from a wrapper script.","solutions":["Verify `rg --help | grep 'OPTIONS:'` returns a section header in your environment","Update kitty to a release matching your installed ripgrep version","Remove wrappers around rg so the kitten executes the real binary"],"exampleFix":"# before: rg is a wrapper\nalias rg='my_rg_wrapper'\n# after: point PATH at real ripgrep\nexport PATH=\"/usr/bin:$PATH\"","handlingStrategy":"fallback","validationCode":"if out, _ := exec.Command(\"rg\",\"--help\").Output(); !strings.Contains(string(out), \"OPTIONS:\") { /* skip kitten, run rg directly */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't shadow rg with wrapper scripts/aliases","Verify rg --help contains an OPTIONS: section after upgrades"],"tags":["kitty","ripgrep","parsing","environment"],"backgroundTag":"help-output-parse-failure","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}