Expand description
rgx filter subcommand — live/non-interactive regex filter over stdin or a file.
Re-exports§
Modules§
- app
- TUI-mode state for
rgx filter. - json_
path - Minimal dotted/indexed path language for JSONL field extraction.
- run
- TUI event loop for
rgx filter. - ui
- Rendering for
rgx filterTUI mode.
Structs§
Constants§
- EXIT_
ERROR - EXIT_
MATCH - Exit codes, matching grep conventions.
- EXIT_
NO_ MATCH
Functions§
- emit_
count - Emit only the count of matched lines.
- emit_
matches - Emit matching lines to
writer. Ifline_numberis true, each line is prefixed with its 1-indexed line number and a colon. - entry
- CLI entry point for
rgx filter. Reads input, decides between non-interactive and TUI modes, and returns an exit code. - extract_
strings - Returns per-line extracted strings.
Nonemeans the line should be excluded from matching (JSON parse failure, path miss, or non-string value). The returned vector has the same length aslines, so callers can index it directly alongside the raw lines. - filter_
lines - Apply the pattern to each line. Returns the 0-indexed line numbers of every
line whose match status (matches vs. invert) satisfies
options.invert. - filter_
lines_ with_ extracted - Apply the pattern to the extracted string for each line. Lines whose
extracted[i]isNoneare excluded from the match set regardless of whether the pattern is empty orinvertis set — a missing/non-string field is not a “line” for matching purposes. - read_
input - Read all lines from either a file path or the provided reader (typically stdin).
Trailing
\n/\r\nis stripped per line. A trailing empty line (from a terminating newline) is dropped.