diff options
author | Ulrich Müller <ulm@gentoo.org> | 2023-02-28 19:06:25 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2023-02-28 19:06:25 +0100 |
commit | ed29a63568537bb2f4e341ad1415060402b4c21f (patch) | |
tree | 663650b2705a05d2bd9db16b2cd0885743028a0f | |
parent | Update version to 1.4.21 (diff) | |
download | eselect-ed29a63568537bb2f4e341ad1415060402b4c21f.tar.gz eselect-ed29a63568537bb2f4e341ad1415060402b4c21f.tar.bz2 eselect-ed29a63568537bb2f4e341ad1415060402b4c21f.zip |
Support NO_COLOR
* bin/eselect.in: Disable colours if NO_COLOR is nonempty.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | bin/eselect.in | 3 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,7 @@ +2023-02-28 Ulrich Müller <ulm@gentoo.org> + + * bin/eselect.in: Disable colours if NO_COLOR is nonempty. + 2023-02-27 Ulrich Müller <ulm@gentoo.org> * 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 |