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

Make -nohidden position independent #30

Closed
kaushalmodi opened this issue Oct 13, 2017 · 3 comments
Closed

Make -nohidden position independent #30

kaushalmodi opened this issue Oct 13, 2017 · 3 comments

Comments

@kaushalmodi
Copy link

Hello,

When I do:

bfs -nohidden . -name "*foo*"

it works great! Fast, and ignoring dirs starting with ., as expected.

But when I do:

bfs . -name "*foo*" -nohidden

the -nohidden switch is not effective.. I get search results from hidden dirs too (dirs starting with .)!

@tavianator
Copy link
Owner

That command line is equivalent to bfs -name '*foo*' -and -nohidden, and since -and is short-circuiting, -nohidden doesn't even get a chance to run if -name '*foo' returns false. So it will filter out any hidden files/directories that match *foo* but no other ones. I agree that this is confusing, and I'm open to suggestions of better semantics for it.

@kaushalmodi
Copy link
Author

I agree that this is confusing, and I'm open to suggestions of better semantics for it.

I don't code in C. So I wish I could have provided some useful suggestions. Dumb thought: Is it possible to treat -nohidden as a special switch, and not AND it with the rest?

@tavianator
Copy link
Owner

That would be possible yeah, I'll try it out and see how nice it is in practice.

Related to #8.

@tavianator tavianator added this to the 2.0 milestone Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants