3 # Copyright (C) 1998, 2002, 2006, 2007 Free Software Foundation
5 # Modified for XZ Utils by Andrew Dudman and Lasse Collin.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 #SET_PATH - This line is a placeholder to ease patching this script.
19 # Instead of unsetting XZ_OPT, just make sure that xz will use file format
20 # autodetection. This way memory usage limit and thread limit can be
21 # specified via XZ_OPT.
22 xz='@xz@ --format=auto'
24 version='xzless (@PACKAGE_NAME@) @VERSION@'
26 usage="Usage: ${0##*/} [OPTION]... [FILE]...
27 Like 'less', but operate on the uncompressed contents of xz compressed FILEs.
29 Options are the same as for 'less'.
31 Report bugs to <@PACKAGE_BUGREPORT@>."
34 --help) echo "$usage" || exit 2; exit;;
35 --version) echo "$version" || exit 2; exit;;
38 if test "${LESSMETACHARS+set}" != set; then
39 # Work around a bug in less 394 and earlier;
40 # it mishandles the metacharacters '$%=~'.
45 LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
48 LESSOPEN="|$xz -cdfq -- %s"
49 export LESSMETACHARS LESSOPEN