You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
grep: residual clap fallbacks for -E/-H/-l and other unhandled flags #97
After #88 (which fixed -r/-R/--recursive/-A/-B/-C), the production tracking DB still shows ~16 grep parse_failures in a 2-hour post-reinstall window. Sample of the flags that still clap-fail:
The common factor: grep flags that Commands::Grep's clap definition doesn't know — -E (extended regex), -H (with-filename), -l (already claimed by clap for --max-len), -o, -w-in-bundles, etc. Each unknown flag triggers run_fallback → raw exec, zero filtering, a parse_failures row.
Scope
#88 deliberately covered only recursive + context flags. This issue is the remaining long tail.
Fix options
Extend the pre-clap stripper / passthrough routing (preprocess_grep_args in main.rs) to recognise the full set of standard grep search-behaviour flags and route them — most are rg-compatible, so run_grep_format_passthrough (which already shells to rg with check_forbidden_rg_args) can handle them.
-E specifically: ripgrep is extended-regex by default, so -E is a no-op for rg — strip it like -r.
-H: rg shows filenames by default in recursive mode; -H forcing it is benign — strip or passthrough.
-l: already noted in main.rs — clap claims -l for --max-len. The format-flag intercept (grep_format_flag_present) handles --files-with-matches but not bare -l. Consider routing bare grep -l to passthrough explicitly.
Recommend: enumerate the standard GNU/BSD grep flags, classify each as {strip, passthrough-to-rg, already-handled}, and make preprocess_grep_args exhaustive. Add a test matrix.
Acceptance
grep -E, -H, -l, -o, and common bundles produce filtered output or a tracked rg-passthrough — never a run_fallback / parse_failures row.
Post-fix: zero grep parse_failures accumulate over a normal session.
Activity
fix(cli): close pre-clap intercept gaps for meta flags and grep
fix(security): route all meta-passthrough bins to tool-specific harde…