4 ms·
but the structure generator and decoder would be so closely coupled they might as well be the same program. Alternatively, you could have grep take a list of c
by markrages 8y ago
but the structure generator and decoder would be so closely coupled they might as well be the same program.
Alternatively, you could have grep take a list of colors from a config file or environment variable and blindly interpolate those strings to make colored output[1]. This also allows color to show up automatically for interactive use.
[1] this is in fact how grep works.
- hvis 8y agoThat's not all one might want to do the structured out. Think of converting to HTML, as one example.
- markrages 8y agolsusb | grep --color=always Linux | aha > grepped.html
- burntsushi 8y agoripgrep does have a JSON output mode, if you're curious. Of course, ripgrep handles coloring like GNU grep does.