ack3
ack3 copied to clipboard
Add option for color search
An idea that I had that would be very useful and kind of straightforward to implement (still lots of special cases sadly) would be a color search.
Let's say I enter
ack --colorsearch "#ff0000"
and internally it searches for red
, #f00
, #ff0000
, rgb(255, 0, 0)
, ...
This would be greatly appreciated I think!
Thanks for the idea. That's a pretty specific use case that has an awful lot of edge cases. I think it might be easier for you to implement it yourself with shell aliases.
Maybe you'd want a shell script wrapper around ack that was able to take a color and make those different patterns, so that if you typed
colorack ffcc22
it would translate that to
ack '(#fc2\b|#ffcc22\b|\brgb\(\s*255\s*,\s*204\s*,\s*34\s*\))'
ack by design does not know anything about the text it's searching.
Hmm, maybe I'll add this to #Cookbook https://github.com/beyondgrep/website/issues/103