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