add support for matching multiple patterns#1139
add support for matching multiple patterns#1139sharkdp merged 5 commits intosharkdp:masterfrom Uthar:master
Conversation
|
Thank you very much for your contribution! Before we consider the integration of this new feature, please see my comment in #315 (comment):
Ideally, the second point should be discussed in detail and represented in corresponding unit tests. |
IMHO I like |
I think the No such nesting like you described would be possible I don't know all of fd's flags, but it looks to me like it will compose well, being just an additional filter for names.
I created some basic unit tests. What other cases should be covered? Some ideas:
|
Sounds reasonable. I would still like to see some thought going into potential conflicts (or chances for combination) with other command line options. To further elaborate what I meant by the quoted example, consider Since
which might certainly be a bit confusing. Especially if someone writes this as: (which would do the same thing, as we don't care about the order of options) Other potentially interesting options to look at:
That is definitely worth checking. Another thing to potentially test would be patterns starting with a dash. Usually, we solve this using the |
One could also use |
|
Hmm you're right, maybe an |
|
Wrote tests for all these in new commit:
case is ignored in
case is sensitive in
didn't check, I didn't know how
With also added these from my post:
tests fails for non-ubuntu CI... let me check... |
Can't make sense out of it. Is there some Mac and Windows experts on board? |
|
We probably want to clearly document how Regarding hyphens. We probably want to use the |
|
Yes, I will attempt to solve this, stay tuned |
|
Damn, looks like I will have to write it from scratch |
|
I will reopen once I have some more time |
|
I'm willing to help if you would like. After all, I made the PR that caused most of the conflicts. |
|
Very nice of you tmccombs. My main problem is to write the code again, it takes a lot of time especially debugging the type errors with borrow and so on, because I lack experience. I just don't have the time right now Ultimately we just have to change Line 153 in 567ce26 Everything else is just argument parsing/changing parameters to functions |
|
I started some work here, the easy stuff :-) https://github.com/Uthar/fd/tree/conflicts |
|
Ok, I've got this working now...
|
|
Full diff here master...Uthar:fd:conflicts |
|
Done after all, we're back in the game :-) But you should review the changes |
|
Thank you. The tests are currently failing on Windows and macOS |
|
yeah... the failuress are really weird, dont make sense... My friend has a macbook, I will ask them to try on it, also try to find a windows machine |
|
fixed the tests |
|
Thank you, tmccombs, for the thorough review. See the last commit, where I added your solution to avoid Let me know if you have some other improvement ideas. |
|
Line 47 in 882e13a pattern -> patterns |
|
So the |
|
Lines 438 to 442 in d498724 The pattern -> A pattern / Some patterns ? |
No, I like
Maybe: "The pattern(s) seems to only match… or adjust your search pattern(s)". |
sharkdp
left a comment
There was a problem hiding this comment.
Thank you. I made a couple of minor improvements.
Added the
--and--expr--andflags that search for matches containing all the patterns, similar to the-andflag of GNU find.minad/consult#6
#315