Skip to content

feat(builtins): implement find -exec command execution#386

Merged
chaliy merged 1 commit intomainfrom
claude/fix-320-find-exec-Vvs93
Feb 27, 2026
Merged

feat(builtins): implement find -exec command execution#386
chaliy merged 1 commit intomainfrom
claude/fix-320-find-exec-Vvs93

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 27, 2026

Summary

Closes #320.

  • Intercept find -exec at interpreter level (same pattern as xargs/timeout) so commands execute through the interpreter instead of silently printing paths
  • Support per-file mode (find -exec cmd {} \;) and batch mode (find -exec cmd {} +) with {} placeholder substitution
  • Remove WTF comment and dead has_exec field; make glob_match reusable via pub(crate) export

Test plan

  • test_find_exec_per_file - executes command for each matched file
  • test_find_exec_batch_mode - executes command once with all paths
  • test_find_exec_cat_reads_files - verifies actual command execution (cat reads file contents)
  • test_find_exec_with_type_filter - respects -type filter with -exec
  • test_find_exec_nonexistent_path - error handling for missing paths
  • test_find_exec_no_matches - no execution when nothing matches
  • test_find_exec_multiple_placeholder - multiple {} in command template
  • Full test suite passes (1120+ tests, 0 failures)

@chaliy chaliy force-pushed the claude/fix-320-find-exec-Vvs93 branch from d7076a7 to d626f1c Compare February 27, 2026 23:14
Closes #320. The find builtin's -exec flag was parsed but acted like
-print because the builtin lacked interpreter access. Now find -exec
is intercepted at the interpreter level (like xargs/timeout) so
commands are executed via the interpreter for each matched path.

Supports both per-file (-exec cmd {} \;) and batch (-exec cmd {} +)
modes with {} placeholder substitution.

https://claude.ai/code/session_01QbjrsMFJbHy5XfHCzA6TjM
@chaliy chaliy force-pushed the claude/fix-320-find-exec-Vvs93 branch from d626f1c to b6e7ba5 Compare February 27, 2026 23:41
@chaliy chaliy merged commit 385ded2 into main Feb 27, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: implement find -exec with interpreter access

2 participants