Do you think it would be valuable to add an option to skip traversing directories? I know I can use an .rgignore file but it's not convenient to copy it from repository to repository.
If so, I think I could try and implement it as well.
I was just looking for an option to not recurse, so yeah, that'd be useful.
I think rg -g '!*/' PAT will do it.
That's not to say we don't want, say, a --depth flag or something that sets a limit on the recursion depth. I think I'd be OK with that. (Certainly, find has it.) Maybe use the same flag name as find? --maxdepth. A depth of 0 could mean "only search current directory."
Ah I missed the -g flag. I suppose I need to read the usage more carefully. I imagine max depth would be easy to add considering you use your walkdir crate too :)
Yes indeedy! Let me know if you'd like to work on it and I won't touch it. :-)
(I think maxdepth should be relatively straight-forward. mindepth would not be. Thankfully, there's less of a use case for that I think.)
I would be happy to try it tonight and I'll keep you updated in this thread. Thanks!
Awesome, thank you. :-)
Most helpful comment
I think
rg -g '!*/' PATwill do it.