Like grep, colorize the output only if stdout is connected to a terminal
authorAlexander Popov <alex.popov@linux.com>
Sun, 21 Apr 2024 22:39:17 +0000 (01:39 +0300)
committerAlexander Popov <alex.popov@linux.com>
Sun, 21 Apr 2024 22:39:17 +0000 (01:39 +0300)
commit21cec11eb005e77917a7263a0f164a80deca0e04
treeaeb228152622b946b5019b68d7ceb4d151e86dc0
parent0b96b5b48d1d5fdd18629a26b7ecd0b659fadad7
Like grep, colorize the output only if stdout is connected to a terminal

Nice.
With this, if you redirect the output of kernel-hardening-checker to a file,
it doesn't contain the ANSI escape sequences for colorizing.
kernel_hardening_checker/engine.py
kernel_hardening_checker/test_engine.py