From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9009E15802E for ; Tue, 25 Jun 2024 04:06:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 210F3E2A58; Tue, 25 Jun 2024 04:06:58 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E9A57E2A57 for ; Tue, 25 Jun 2024 04:06:57 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 005D1335D64 for ; Tue, 25 Jun 2024 04:06:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 91FD01D32 for ; Tue, 25 Jun 2024 04:06:55 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1719177555.94446b64cc9f9a912184a85fa43070fecbc4ce0f.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: functions/ X-VCS-Repository: proj/gentoo-functions X-VCS-Files: functions/rc.sh X-VCS-Directories: functions/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 94446b64cc9f9a912184a85fa43070fecbc4ce0f X-VCS-Branch: master Date: Tue, 25 Jun 2024 04:06:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4855a61b-ad51-412e-93e7-65243b1fa5da X-Archives-Hash: 315439f8f76e75def9d1a6bd9c41f213 commit: 94446b64cc9f9a912184a85fa43070fecbc4ce0f Author: Kerin Millar plushkava net> AuthorDate: Wed Jun 12 12:51:55 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sun Jun 23 21:19:15 2024 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=94446b64 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 plushkava.net> 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