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 78537158094 for ; Thu, 28 Jul 2022 15:29:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 26CC0E0BA4; Thu, 28 Jul 2022 15:29:10 +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 EFEC4E0B9E for ; Thu, 28 Jul 2022 15:29:09 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 smtp.gentoo.org (Postfix) with ESMTPS id D914334118E for ; Thu, 28 Jul 2022 15:29:08 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 20037553 for ; Thu, 28 Jul 2022 15:29:07 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1659021775.9a402fba0d63240685a2326926060c3c8c523101.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/equery/__init__.py X-VCS-Directories: pym/gentoolkit/equery/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 9a402fba0d63240685a2326926060c3c8c523101 X-VCS-Branch: master Date: Thu, 28 Jul 2022 15:29:07 +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: 8d5ca0fd-e646-4b4d-9ac3-e0f433e8f757 X-Archives-Hash: e5016d8cec3f5ad5474758c7f29cdc5d commit: 9a402fba0d63240685a2326926060c3c8c523101 Author: Brian Dolbec gentoo org> AuthorDate: Thu Jul 28 15:22:55 2022 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Thu Jul 28 15:22:55 2022 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=9a402fba equery: Set nocolor for piping to after options are parsed Fixes commit 84ffe42e5 which set nocolor before options were parsed. Bug: https://bugs.gentoo.org/861116 Signed-off-by: Brian Dolbec gentoo.org> pym/gentoolkit/equery/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pym/gentoolkit/equery/__init__.py b/pym/gentoolkit/equery/__init__.py index 56b2caa..ae760c1 100644 --- a/pym/gentoolkit/equery/__init__.py +++ b/pym/gentoolkit/equery/__init__.py @@ -228,8 +228,6 @@ def initialize_configuration(): # set extra wide, should disable wrapping unless # there is some extra long text CONFIG["termWidth"] = 600 - # turn off color - pp.output.nocolor() CONFIG["debug"] = bool(os.getenv("DEBUG", False)) @@ -338,6 +336,10 @@ def main(argv): else: CONFIG["verbose"] = True + if CONFIG["piping"]: + # turn off color + pp.output.nocolor() + try: module_name, module_args = split_arguments(args) except IndexError: