You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm, I like this idea, but there are a couple complications:
Technically, the matched part is either the whole filename or the whole path. That is, with -name '*foo*', the pattern *foo* matches the entirety of the filename. Similarly, for -regex '.*foo.*', the regex matches the entire path. I suppose the most helpful thing is to ignore any leading/trailing wildcards (or, for regexes, maybe use the first capture group?).
For more complicated expressions, it may not be clear what the matched part was. For example, -name 'foo*' -a -name '*bar' -o -name '*baz*'. But the simplest cases (just -name 'blah') can be handled.
That also explains why -regex substring didn't match anything.
Could there maybe be an extra mode, or matcher, that's designed more for the use-case of "finding a file"? Something more along the lines of grep? (bfs -grep?)
I think it would help with readability if matched substrings were highlighted in some way (eg: with a yellow background).
It would be extra helpful for regular expressions, where the patterns are abstract.
A workaround is to run
bfs | grep --color
, but this removes all of bfs' beautiful filetype colour coding!The text was updated successfully, but these errors were encountered: