-
-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-prune
options
#535
Comments
Thank you for your feedback. Can you please give us some examples of actual (non-hypothetical) use cases for this? |
@sharkdp Yes of course :) I don't want to display a directory if one of the parent directory has matched the search :) With the find tool, I can use the option |
Ok, let's try to implement this as a new flag. We can hide it from the short |
Hello. I'd like to take this if its available? |
Clarification on behavior: is prune meant to be a flag to operate on <pattern>?
|
Yes :) it should work like this (the tool should stop to explore sub-directories when the current directories has matched) |
- Added --prune option which will not descend into directories that are a match on pattern. - Added test to cover --prune option.
I'm happy to see that this is in the works! |
I have another use-case to share. For those unaware, a Also, this is a common issue, common enough that there's a utility just for this: https://github.com/voidcosmos/npkill. But I would rather use 🙂 |
Unfortunately I only saw this issue today, after it was closed, but I want to point out that the use of For example, suppose that I am searching files that match a pattern in all of the tools installed on my system, but I do not want documentation files. Moreover, running
This will skip the processing of anything named It may be too late to support this in |
I think this use case is covered by |
@reima Ah, yes, my mistake. Thanks! |
released in v8.2.0. |
this prune behaviour is perfect when descendants of a match are no longer relevant. perhaps you want to delete every directory called 'node_modules' :) ty for adding it. |
Is it possible to add an option
-prune
, to not explore sub-directories, when the current directory has been matched ? (likefind -prune
)The text was updated successfully, but these errors were encountered: