#!/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;
