X-Git-Url: http://git.tpope.net/?p=tpope-extra.git;a=blobdiff_plain;f=enscript%2Fenscript.pl;fp=enscript%2Fenscript.pl;h=1253b277a313be497e221e3327446b28aa2c7c27;hp=0000000000000000000000000000000000000000;hb=4c2d2e5111e5fe30a46c8406af1d7aef1031c1e8;hpb=34889fc02b828530ad16d44d70389a75e0f65427 diff --git a/enscript/enscript.pl b/enscript/enscript.pl new file mode 100755 index 0000000..1253b27 --- /dev/null +++ b/enscript/enscript.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w +# $Id$ +# -*- perl -*- vim: ft=perl sw=4 sts=4 + +# This purpose of this script is to let enscript decide how to highlight a +# file when called by cvsweb, despite cvsweb's retarded insistance on making +# the decision itself. Presumably, it can be adapted to work with viewcvs as +# well, which has the same problem. + +# To use it, first tell cvsweb in cvsweb.conf to use this script for enscript: +# $CMD{enscript} = search_path('enscript.pl'); +# +# Then, to the contents of %enscript_types, add +# ' ' => qr/./o +# which forces cvsweb to always call enscript.pl. + +use strict; + +for(my $i=0;$i<=$#ARGV;$i++) { + $ARGV[$i] = "--highlight" if $ARGV[$i] =~ m/^--highlight= *$/; +} + +exec "/usr/bin/enscript", @ARGV;