apparently we now want the checked out tree to be the patched tree?
[debian/gzip] / zless.in
1 #!/bin/sh
2
3 # Copyright (C) 1998, 2002, 2006, 2007 Free Software Foundation
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19 bindir=@bindir@
20 case $1 in
21 --__bindir) bindir=${2?}; shift; shift;;
22 esac
23 PATH=$bindir:$PATH; export PATH
24
25 version="zless (gzip) @VERSION@
26 Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
27 This is free software.  You may redistribute copies of it under the terms of
28 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
29 There is NO WARRANTY, to the extent permitted by law.
30
31 Written by Paul Eggert."
32
33 usage="Usage: $0 [OPTION]... [FILE]...
34 Like 'less', but operate on the uncompressed contents of any compressed FILEs.
35
36 Options are the same as for 'less'.
37
38 Report bugs to <bug-gzip@gnu.org>."
39
40 case $1 in
41 --help)    exec echo "$usage";;
42 --version) exec echo "$version";;
43 esac
44
45 if test "${LESSMETACHARS+set}" != set; then
46   # Work around a bug in less 394 and earlier;
47   # it mishandles the metacharacters '$%=~'.
48   space=' '
49   tab=' '
50   newline='
51 '
52   LESSMETACHARS="$space$tab$newline'"';*?"()<>[|&^`#\$%=~'
53   export LESSMETACHARS
54 fi
55
56 LESSOPEN="|-gzip -cdfq -- %s"; export LESSOPEN
57 exec less "$@"