rtk-ai/rtk
Vedi su GitHubrtk grep falls back to native grep when --fixed-strings is placed before the pattern/path
Open
Aperta il 27 mag 2026
area:clibughelp wantedplatform:windowspriority:medium
Descrizione
I’m on rtk 0.42.0 and hit a confusing behavior with rtk grep on Windows/Git Bash. Repro rtk grep -n --fixed-strings '<select id="selectPage"' "ruoyi-vue-pro/yudao-module-wallet/src/main/resources/mapper/enterpriseaccount" Actual /usr/bin/grep: ruoyi-vue-pro/yudao-module-wallet/src/main/resources/mapper/enterpriseaccount: Is a directory Expected I expected rtk grep to either:
- pass --fixed-strings through to ripgrep, or
- give a clear RTK-level error explaining the required argument order instead of falling back to native grep and failing with a directory error. Notes If I move the extra flag after the pattern/path, it works: rtk grep '<select id="selectPage"' "ruoyi-vue-pro/yudao-module-wallet/src/main/resources/mapper/enterpriseaccount" --fixed-strings So this looks like an argument parsing / routing issue rather than a grep engine limitation. I also noticed related behavior in existing issues around grep flags and passthrough:
- -E / native grep-style flags
- -n compatibility
- extra_args handling for rtk grep It seems rtk grep only accepts extra ripgrep args after the positional pattern/path, but that’s easy to miss because people naturally write flags first, like normal grep/rg. Why this matters This makes a common search command fail in a surprising way, and the fallback error points to native grep, which hides the real issue. Suggested fix Either:
- allow common ripgrep flags like --fixed-strings before the pattern/path for rtk grep, or
- emit a clear parse error telling users to place extra args after the pattern/path, instead of falling back to native grep