]> git.ipfire.org Git - thirdparty/iproute2.git/commit
color: Handle NO_COLOR environment variable in default_color_opt()
authorBen Hutchings <benh@debian.org>
Wed, 19 Mar 2025 21:51:57 +0000 (22:51 +0100)
committerDavid Ahern <dsahern@kernel.org>
Mon, 24 Mar 2025 02:50:54 +0000 (02:50 +0000)
commitf0076a016cf7926f39c47b95dae0002249c082dc
tree40114cb0406d58a12f0a38d3985c84cc04359592
parent446edf9ef8055125a8ef28a9d9218b05971ee465
color: Handle NO_COLOR environment variable in default_color_opt()

The NO_COLOR environment variable is a widely supported way for users
to disable coloured text output.  See <https://no-color.org/>.  In
case iproute2 is configured to use colours by default, allow this to
be overridden by setting NO_COLOR.

This is done in default_color_opt() so that colours can still be
explicitly enabled with a command-line option.

Signed-off-by: Ben Hutchings <benh@debian.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
lib/color.c