]> icculus.org git repositories - icculus/xz.git/commit
xzless: Support compressed standard input
authorJonathan Nieder <jrnieder@gmail.com>
Sun, 9 Aug 2009 18:22:12 +0000 (13:22 -0500)
committerLasse Collin <lasse.collin@tukaani.org>
Sun, 9 Aug 2009 19:27:22 +0000 (22:27 +0300)
commit1d314b81aa5b0c4530638ffabd4e0edb52e5362c
treef3e478912cf18aa0d58a7ec72d641c3cf0b55987
parenta7f5d2fe4826ac68839d00059f05004fb81d5c69
xzless: Support compressed standard input

It can be somewhat confusing that

less < some_file.txt

works fine, whereas

xzless < some_file.txt.xz

does not.  Since version 429, ‘less’ allows a filter specified in
the LESSOPEN environment variable to preprocess its input even if
it comes from standard input, if $LESSOPEN begins with ‘|-’.  So
set $LESSOPEN to take advantage of this feature.

Check less’s version at runtime so xzless can continue to work
with older versions.
src/scripts/xzless.in