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 0BDD5158030 for ; Tue, 28 Feb 2023 18:08:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 555F4E03EC; Tue, 28 Feb 2023 18:08:06 +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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3B0BEE03EC for ; Tue, 28 Feb 2023 18:08:06 +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 5A2FD33FEFB for ; Tue, 28 Feb 2023 18:08:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BE24A807 for ; Tue, 28 Feb 2023 18:08:03 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1677607585.ed29a63568537bb2f4e341ad1415060402b4c21f.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:master commit in: bin/, / X-VCS-Repository: proj/eselect X-VCS-Files: ChangeLog bin/eselect.in X-VCS-Directories: / bin/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: ed29a63568537bb2f4e341ad1415060402b4c21f X-VCS-Branch: master Date: Tue, 28 Feb 2023 18:08:03 +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: fdfa81ed-7902-47aa-858a-b0b76016337d X-Archives-Hash: 2fe22f47ac1b2422915a8c7f04634ad1 commit: ed29a63568537bb2f4e341ad1415060402b4c21f Author: Ulrich Müller gentoo org> AuthorDate: Tue Feb 28 18:06:25 2023 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Tue Feb 28 18:06:25 2023 +0000 URL: https://gitweb.gentoo.org/proj/eselect.git/commit/?id=ed29a635 Support NO_COLOR * bin/eselect.in: Disable colours if NO_COLOR is nonempty. Signed-off-by: Ulrich Müller gentoo.org> ChangeLog | 4 ++++ bin/eselect.in | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 64a5b5e..aab936d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2023-02-28 Ulrich Müller + + * bin/eselect.in: Disable colours if NO_COLOR is nonempty. + 2023-02-27 Ulrich Müller * configure.ac: Update version to 1.4.21. diff --git a/bin/eselect.in b/bin/eselect.in index a521a6f..888977c 100755 --- a/bin/eselect.in +++ b/bin/eselect.in @@ -136,6 +136,7 @@ if [[ -z ${action} ]]; then fi # parse global options +colour="" while [[ ${1##--} != "$1" ]]; do case ${1##--} in brief) @@ -185,6 +186,8 @@ fi # enable colour output and get width of terminal iff stdout is a tty if [[ -t 1 ]]; then + # command line option overrides NO_COLOR variable + [[ -z ${colour} && -n ${NO_COLOR} ]] && colour=no colours ${colour:-yes} init_columns else