-
-
Notifications
You must be signed in to change notification settings - Fork 845
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 --type empty
its own option
#823
Comments
I don't think an empty socket or pipe makes sense. Does an empty symlink mean the target of the symlink is empty? |
I'd assume so, but it's not so much about adding functionality by allowing to search for empty symlinks; rather, it's more about having a consistent behaviour. I find it kind of confusing because the help suggests a different behaviour to what is actually happening. A solution would be to document the special case in the help and leave it, but I don't think that will fix the underlying issue, which is, in my opinion, with the "flawed" design. If you feel that it is fine, feel free to close the issue, this issue is based on my subjective opinion, so you and others may disagree. |
So is this proposal to add a new And what about I'm not saying we shouldn't do this, just trying to get a clear idea of what would change. I wonder if maybe there should be a different grouping that has things like |
Yea the proposal is to add a new I didn't want to suggest I think some sort of |
No, it tests if the directory has the I've started a branch to address this, I'll post a PR shortly. |
But keep the old file types for backwards compatibility. Fixes sharkdp#823
Thank you for reporting and discussing this, @tsoutsman and @tmccombs. The current behavior of the But I don't really see that we need a new option for this. I haven't seen any valid use cases which we can not solve with the current option. And I think a certain simplificity in CLI design is a very valuable feature of I am proposing that we change the
I think those five examples cover a huge percentage of use cases. And I also believe that the current syntax is actually quite intuitive... unless someone tries to interpret it as a strict I agree that it's not fully satisfactory, but I still like this better than introducing a completely new command line option. What do you think @tmccombs @tsoutsman? |
I'm closing this and #847 for now, let me know if someone wants to discuss this further. |
the help
multiple allowable filetypes can be specified
suggests that adding multiple type parameters will have anOR
effect (if a file is any of the types then it will be included in the results), but this is not always the case. In particular, theempty
type is inconsistent. When used withsymlink
,socket
, orpipe
, it works in accordance with the help, anything that isempty
OR
the other type will be included. However, if you use it withfile
,executable
, ordirectory
it will only include results if they are bothempty
AND
the other type (e.g.fd --type empty --type directory
only includes empty directories.empty
being a type prevents me from searching for empty symlinks, sockets, or pipes. (I'm not sure if these are possible but I digress)This issue is touched upon in #714 :
I think
empty
being made its own option would fix this issue, removing any confusion.The text was updated successfully, but these errors were encountered: