mirror of
https://github.com/rtk-ai/rtk.git
synced 2026-09-19 07:33:17 +08:00
0adfae6cf6
The grep argument-parsing rework routed many flag shapes through the grouping reparse, which silently dropped any line it could not parse and returned a success exit. Common invocations produced wrong or empty output -- and grep-only syntax like `--include` failed outright -- which pushed agents back to unfiltered `rtk proxy grep`. Every valid grep invocation now produces correct output: - Context (`-A`/`-B`/`-C`) is grouped and compressed instead of dropped; the header counts matches only and context lines are shown. - Output the reparse cannot represent (`-N`, `-I`, `--color`, `-p`, `--heading`, binary-file notices, ...) is passed through verbatim instead of reported as a false "0 matches". - Format/shape flags (`-c`, `-l`, `-o`, `-Z`, `--column`, `-b`, `--vimgrep`, `--null-data`) pass through cleanly with no NUL leak. - grep-only syntax (`--include`, `--exclude`, ...) works: ripgrep is the fast path and rtk falls back to system grep when ripgrep rejects a flag. - rtk grep never emits more than plain grep: if grouping is not smaller than `file:line:content`, the raw form is shown. Resolves #2543.
3.0 KiB
3.0 KiB