#! /bin/csh -f
# Last edited on 2001-11-05 10:05:16 by stolfi

set usage = "$0 [-filter FILTER] FILE"
# Prints a FILE with header and footer line

set filter = ( cat )
while ( ( $#argv >= 1 ) && ( "x$1" =~ x-* ) ) 
  if ( ( $#argv >= 2 ) && ( "x$1" == "x-filter" ) ) then
    set filter = ( "$2" ); shift; shift
  else
    echo "bad option; usage = ${usage}"; exit 1
  endif
end

if ( $#argv != 1 ) then
  echo "usage: $usage"; exit 1
endif

set file = "$1";
set dash = "`echo ${file} | /bin/sed -e 's/./-/g'`"

/usr/bin/printf '--- %s ------------------------\n' "${file}"
/bin/cat ${file} | ${filter}
/usr/bin/printf '----%s-------------------------\n' "${dash}"
