feat(find): add -mindepth option to find builtin#515
Merged
Conversation
find -mindepth N was unrecognized, causing `find . -mindepth 1 -type f | wc -l` to output 0 (find errored on unknown predicate, producing no stdout). Add min_depth field to FindOptions, parse -mindepth argument, and suppress output for entries below the minimum depth threshold. https://claude.ai/code/session_016LNVVjp5EuQXhaQRpoS6jd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
find -mindepth Nwas unrecognized, causingfind . -mindepth 1 -type f | wc -lto return0(find errored on unknown predicate, producing no stdout forwc -l)min_depthfield toFindOptions,-mindepthargument parsing, and depth-gating infind_recursiveto suppress output below the threshold005-builtins.mdto document-mindepth NTest plan
test_find_mindepth,test_find_mindepth_with_type(reproduces exact reported issue),test_find_mindepth_2,test_find_mindepth_missing_arg,test_find_mindepth_invalid_valuefind_mindepth,find_mindepth_2— verified matching real bash outputcargo fmt --checkcleancargo clippy --all-targets --all-features -- -D warningsclean