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 BFECD15800F for ; Wed, 15 Feb 2023 02:24:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8B97FE07C5; Wed, 15 Feb 2023 02:24:48 +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 6DEDAE07C5 for ; Wed, 15 Feb 2023 02:24:48 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2EECD340DCC for ; Wed, 15 Feb 2023 02:24:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4D2B48AD for ; Wed, 15 Feb 2023 02:24:45 +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: <1676427253.4f3b38f5c910980352c76de3f99b3bd4d6534cbc.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: / X-VCS-Repository: proj/gentoo-functions X-VCS-Files: functions.sh X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 4f3b38f5c910980352c76de3f99b3bd4d6534cbc X-VCS-Branch: master Date: Wed, 15 Feb 2023 02:24:45 +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: 3b6f06bd-02ed-485f-9b60-dcc3cc4d8af8 X-Archives-Hash: 3482959520388185839fd4af8e2caf34 commit: 4f3b38f5c910980352c76de3f99b3bd4d6534cbc Author: Kerin Millar plushkava net> AuthorDate: Wed Feb 15 00:51:10 2023 +0000 Commit: Sam James gentoo org> CommitDate: Wed Feb 15 02:14:13 2023 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=4f3b38f5 Drop the RC_DEFAULT_INDENT variable Clearly, it's not intended to be configurable, otherwise it would have been written as RC_DEFAULT_INDENT=${RC_DEFAULT_INDENT:-2}. It is only expanded in two places, so things are made simpler by getting rid of it. Doing so further increases the reliability of the library. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> functions.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/functions.sh b/functions.sh index 19e4a37..c911fe3 100644 --- a/functions.sh +++ b/functions.sh @@ -29,7 +29,7 @@ _esetdent() eindent() { if ! is_int "$1" || [ "$1" -le 0 ]; then - set -- "${RC_DEFAULT_INDENT}" + set -- 2 fi _esetdent "$(( ${#RC_INDENTATION} + $1 ))" } @@ -40,7 +40,7 @@ eindent() eoutdent() { if ! is_int "$1" || [ "$1" -le 0 ]; then - set -- "${RC_DEFAULT_INDENT}" + set -- 2 fi _esetdent "$(( ${#RC_INDENTATION} - $1 ))" } @@ -489,9 +489,8 @@ RC_NOCOLOR="${RC_NOCOLOR:-no}" # Can the terminal handle endcols? Begin by assuming not. unset -v ENDCOL -# Default values for e-message indentation and dots -RC_INDENTATION='' -RC_DEFAULT_INDENT=2 +# Set the initial value for e-message indentation. +RC_INDENTATION= # If either STDOUT or STDERR is not a tty, disable coloured output. A useful # improvement for the future would be to have the individual logging functions