-
Notifications
You must be signed in to change notification settings - Fork 95
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Summary
rtk grep currently returns exit 0 for failure modes where rg returns non-zero.
This breaks CLI parity and forces downstream users to route rg|grep through raw proxy for safety.
Environment
- RTK:
rtk 0.20.0 - OS: Linux (WSL2 Ubuntu)
- rg:
ripgrep 14.1.1
Reproduction
TMP=/tmp/rtk-parity-grep.txt
printf "alpha\nbeta\n" > "$TMP"
rtk grep "zzz" "$TMP"; echo "rtk no-match: $?"
rg "zzz" "$TMP"; echo "rg no-match: $?"
rtk grep "[" "$TMP"; echo "rtk invalid-regex: $?"
rg "[" "$TMP"; echo "rg invalid-regex: $?"
rtk grep "alpha" /tmp/does-not-exist-rtk-xyz.txt; echo "rtk missing-file: $?"
rg "alpha" /tmp/does-not-exist-rtk-xyz.txt; echo "rg missing-file: $?"Actual
rtk no-match: 0(output:🔍 0 for 'zzz')rtk invalid-regex: 0(output:🔍 0 for '[')rtk missing-file: 0(output:🔍 0 for 'alpha')
Expected (parity with rg)
- no-match ->
exit 1 - invalid regex ->
exit 2 - missing file ->
exit 2
Why this matters
Shell workflows and hooks rely on exit code semantics for control flow. Returning 0 for these cases causes false-success behavior.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers