diff options
author | 2006-11-27 00:33:09 +0000 | |
---|---|---|
committer | 2006-11-27 00:33:09 +0000 | |
commit | 1a1a4d57a19336ebe3bf0712faff9228ba390b4d (patch) | |
tree | 8b90ee574974de3b36b82ab2b5a7661a60235086 /sys-apps/less/files | |
parent | drop autoconf dep since it is only needed for test failures (diff) | |
download | historical-1a1a4d57a19336ebe3bf0712faff9228ba390b4d.tar.gz historical-1a1a4d57a19336ebe3bf0712faff9228ba390b4d.tar.bz2 historical-1a1a4d57a19336ebe3bf0712faff9228ba390b4d.zip |
allow people to always force colorization #156362 by Benno Schulenberg
Package-Manager: portage-2.1.2_rc2-r2
Diffstat (limited to 'sys-apps/less/files')
-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) |