mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 02:04:17 +00:00
cli: fix handling empty NO_COLOR= variable
An empty value NO_COLOR= should not be treated to disable colors.
This is also what [1] says (changed a while ago [2]).
[1] https://no-color.org/
[2] 99f90e27d0
This commit is contained in:
parent
867db80457
commit
0ac5221c40
|
@ -129,7 +129,7 @@
|
|||
<citerefentry><refentrytitle>terminal-colors.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
|
||||
Please refer to the <link linkend='colors' endterm='colors.title' /> section for a
|
||||
list of color names supported by <command>nmcli</command>.</para>
|
||||
<para>If the environment variable <literal>NO_COLOR</literal> is set (to any value),
|
||||
<para>If the environment variable <literal>NO_COLOR</literal> is set (to any non-empty value),
|
||||
then coloring is disabled with mode "auto". Explicitly enabling coloring overrides
|
||||
the environment variable.</para>
|
||||
</listitem>
|
||||
|
|
|
@ -481,7 +481,7 @@ check_colors(NmcColorOption color_option, char **out_palette_str)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (color_option == NMC_USE_COLOR_AUTO && g_getenv("NO_COLOR")) {
|
||||
if (color_option == NMC_USE_COLOR_AUTO && nm_str_not_empty(g_getenv("NO_COLOR"))) {
|
||||
/* https://no-color.org/ */
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue