Assorted away-tpope updates
[tpope-extra.git] / enscript / enscript.pl
1 #!/usr/bin/perl -w
2 # $Id$
3 # -*- perl -*- vim: ft=perl sw=4 sts=4
4
5 # This purpose of this script is to let enscript decide how to highlight a
6 # file when called by cvsweb, despite cvsweb's retarded insistance on making
7 # the decision itself.  Presumably, it can be adapted to work with viewcvs as
8 # well, which has the same problem.
9
10 # To use it, first tell cvsweb in cvsweb.conf to use this script for enscript:
11 # $CMD{enscript} = search_path('enscript.pl');
12 #
13 # Then, to the contents of %enscript_types, add
14 #   ' ' => qr/./o
15 # which forces cvsweb to always call enscript.pl.
16
17 use strict;
18
19 for(my $i=0;$i<=$#ARGV;$i++) {
20     $ARGV[$i] = "--highlight" if $ARGV[$i] =~ m/^--highlight= *$/;
21 }
22
23 exec "/usr/bin/enscript", @ARGV;