kovidgoyal/kitty · error

Failed to parse rg help output, could not find any options

Error message

Failed to parse rg help output, could not find any options

What it means

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.

Source

Thrown at kittens/hyperlinked_grep/main.go:79

					err = fmt.Errorf("Failed to parse rg help output line: %s", line)
					return
				}
				for _, x := range single_letter_aliases {
					alias_map[x] = long_option_names[0]
				}
				for _, x := range long_option_names[1:] {
					alias_map[x] = long_option_names[0]
				}
				expecting_args[long_option_names[0]] = expecting_arg
			}
		} else {
			if strings.HasSuffix(line, "OPTIONS:") {
				options_started = true
			}
		}
	}
	if len(expecting_args) == 0 || len(alias_map) == 0 {
		err = fmt.Errorf("Failed to parse rg help output, could not find any options")
		return
	}
	return
}

type kitten_options struct {
	matching_lines, context_lines, file_headers    bool
	with_filename, heading, line_number            bool
	stats, count, count_matches                    bool
	files, files_with_matches, files_without_match bool
	vimgrep                                        bool
}

func default_kitten_opts() *kitten_options {
	return &kitten_options{
		matching_lines: true, context_lines: true, file_headers: true,
		with_filename: true, heading: true, line_number: true,
	}

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Verify `rg --help | grep 'OPTIONS:'` returns a section header in your environment
  2. Update kitty to a release matching your installed ripgrep version
  3. Remove wrappers around rg so the kitten executes the real binary

Example fix

# before: rg is a wrapper
alias rg='my_rg_wrapper'
# after: point PATH at real ripgrep
export PATH="/usr/bin:$PATH"
Defensive patterns

Strategy: fallback

Validate before calling

if out, _ := exec.Command("rg","--help").Output(); !strings.Contains(string(out), "OPTIONS:") { /* skip kitten, run rg directly */ }

Prevention

When it happens

Trigger: rg --help output lacking a line ending in 'OPTIONS:' (major help-format change), empty output, or a non-ripgrep binary responding differently.

Common situations: 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.

Understand the failure class

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/f2a20728eaadee61. Report an issue: GitHub.