diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-11-27 00:33:09 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-11-27 00:33:09 +0000 |
commit | c19c96de7e6648388e567174be70476383d352ae (patch) | |
tree | 7313580bcdabbba84dcbcbeb2faf2d80ff5f0dc1 | |
parent | drop autoconf dep since it is only needed for test failures (diff) | |
download | gentoo-2-c19c96de7e6648388e567174be70476383d352ae.tar.gz gentoo-2-c19c96de7e6648388e567174be70476383d352ae.tar.bz2 gentoo-2-c19c96de7e6648388e567174be70476383d352ae.zip |
allow people to always force colorization #156362 by Benno Schulenberg
(Portage version: 2.1.2_rc2-r2)
-rw-r--r-- | sys-apps/less/files/lesspipe.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys-apps/less/files/lesspipe.sh b/sys-apps/less/files/lesspipe.sh index d1dae0dc2ea9..de11dc5e2c8e 100644 --- a/sys-apps/less/files/lesspipe.sh +++ b/sys-apps/less/files/lesspipe.sh @@ -136,6 +136,7 @@ lesspipe() { # Allow people to flip color off if they dont want it case ${LESSCOLOR} in + always) LESSCOLOR=2;; [yY][eE][sS]|1|true) LESSCOLOR=1;; [nN][oO]|0|false) LESSCOLOR=0;; *) LESSCOLOR=1;; # default to colorize @@ -146,7 +147,12 @@ lesspipe() { exit 0 fi - # Only colorize if we know less will handle raw codes + # Only colorize if user forces it ... + if [[ ${LESSCOLOR} == "2" ]]; then + ${LESSCOLORIZER} "$1" + exit 0 + fi + # ... or we know less will handle raw codes for opt in ${LESS} ; do if [[ ${opt} == "-r" || ${opt} == "-R" ]] ; then ${LESSCOLORIZER} "$1" @@ -187,10 +193,10 @@ if [[ -z $1 ]] ; then echo "Usage: lesspipe.sh <file>" elif [[ $1 == "-V" ]] ; then Id="cvsid" - cvsid="$Id: lesspipe.sh,v 1.19 2006/11/05 21:58:50 vapier Exp $" + cvsid="$Id: lesspipe.sh,v 1.20 2006/11/27 00:33:09 vapier Exp $" cat <<-EOF $cvsid - Copyright 2001-2005 Gentoo Foundation + Copyright 2001-2006 Gentoo Foundation Mike Frysinger <vapier@gentoo.org> (with plenty of ideas stolen from other projects/distros) |