chiark / gitweb /
journalctl: add highlighting for matched substring
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 27 Jan 2018 12:00:09 +0000 (13:00 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:50:22 +0000 (07:50 +0200)
commit33ab419a61bfb3667f0b99f9804e4315b0e79c15
treeeb3db29d4f5c95cbf3766c91936735952d7baab6
parentc687cd959206402ddc1032137566818f0fdd9beb
journalctl: add highlighting for matched substring

Red is used for highligting, the same as grep does. Except when the line is
highlighted red already, because it has high priority, in which case plain ansi
highlight is used for the matched substring.

Coloring is implemented for short and cat outputs, and not for other types.
I guess we could also add it for verbose output in the future.
src/basic/string-util.c
src/basic/string-util.h
src/test/test-strip-tab-ansi.c