From 94446b64cc9f9a912184a85fa43070fecbc4ce0f Mon Sep 17 00:00:00 2001 From: Kerin Millar Date: Wed, 12 Jun 2024 13:51:55 +0100 Subject: Deprecate RC_NOCOLOR and the equivalent use of the positional parameters Firstly, the "." builtin is not specified to support the passing of arguments; such is a bashism. It is rather presumptuous to act as if the present contents of the positional parameters are for the benefit of gentoo-functions at the time of its initialisation. Secondly, there exists a de-facto standard for suppressing colored output, which is to define NO_COLOR as a non-empty string, per https://no-color.org. Signed-off-by: Kerin Millar --- functions/rc.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/rc.sh b/functions/rc.sh index 519d847..2f2dc52 100644 --- a/functions/rc.sh +++ b/functions/rc.sh @@ -422,13 +422,16 @@ _is_visible() #------------------------------------------------------------------------------# # Determine whether the use of color is to be wilfully avoided. -if [ -n "${NO_COLOR}" ]; then +if [ "${RC_NOCOLOR+set}" ]; then + warn "the RC_NOCOLOR variable is deprecated by gentoo-functions; please set NO_COLOR instead" +elif [ -n "${NO_COLOR}" ]; then # See https://no-color.org/. RC_NOCOLOR=yes else for _; do case $_ in --nocolor|--nocolour|-C) + warn "the $_ option is deprecated by gentoo-functions; please set NO_COLOR=1 instead" RC_NOCOLOR=yes break esac -- cgit v1.2.3-65-gdbad