Skip to content
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

Directory ignore command line #109

Closed
gsquire opened this issue Sep 26, 2016 · 7 comments
Closed

Directory ignore command line #109

gsquire opened this issue Sep 26, 2016 · 7 comments
Assignees
Labels
enhancement An enhancement to the functionality of the software.

Comments

@gsquire
Copy link
Contributor

gsquire commented Sep 26, 2016

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.

@lzybkr
Copy link
Contributor

lzybkr commented Sep 26, 2016

I was just looking for an option to not recurse, so yeah, that'd be useful.

@BurntSushi
Copy link
Owner

I think rg -g '!*/' PAT will do it.

@BurntSushi
Copy link
Owner

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."

@gsquire
Copy link
Contributor Author

gsquire commented Sep 26, 2016

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 :)

@BurntSushi
Copy link
Owner

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.)

@gsquire
Copy link
Contributor Author

gsquire commented Sep 26, 2016

I would be happy to try it tonight and I'll keep you updated in this thread. Thanks!

@BurntSushi
Copy link
Owner

Awesome, thank you. :-)

@BurntSushi BurntSushi added the enhancement An enhancement to the functionality of the software. label Sep 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to the functionality of the software.
Projects
None yet
Development

No branches or pull requests

3 participants