-
-
Notifications
You must be signed in to change notification settings - Fork 804
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
Idea: orthogonal specification of patterns and paths #889
Comments
There is already |
Indeed, I believe that allowing multiple patterns would be a huge improvement to the command line interface, making it worthwhile to consider the backwards incompatible change. In order not to surprise current users, the change could be introduced in one of the following ways:
|
Thanks for creating this very useful alternative to classic
find
!Here, I suggest an improvement to the user interface that would make it both simpler and more powerful.
(This idea requires breaking backwards compatibility, but I believe that this would pay off. There are different ways in which such a backward-incompatible change could be realized without surprising current users, so please bear with me.)
I suggest that search paths be provided as a command line option (for example
-r
--root
) and no longer as command line arguments that follow the pattern. Thus, any non-option command line arguments would be search patterns. This would allow providing zero, one or an arbitrary number of search patterns. If more than one search pattern was provided, these would be combined using logical AND.This change would have the following advantages:
Currently it is possible to provide no search path and no search patterns (e.g.
fd -ejpg
), but it is not possible to provide a path without a pattern. This use case would become possible, e.g.fd -ejpg -rsubdir
.Currently there is a way to realize logical OR in patterns. Logical AND would be very useful as well (for example for searching for file names that contain both "foo" and "bar" in any order - see Finding multiple patterns #315), but there is no easy way to express it. Having multiple patterns would provide an intuitive syntax.
The text was updated successfully, but these errors were encountered: