#!/bin/sh
#
# lp -     fake System V lp(1) program for PLP installations.
#
#	   not too much to emulate here, so it's quite convincing. ;)
#
#          -- Justin Mason <jmason@iona.ie> May '94.

PLP_DIR=/usr/local/bin

OPTSTR="cmswrf:d:H:n:o:P:q:S:t:T:y:"

args=
symlink=n # set this to "y" if you're allowing wide use of symlinks; see lpr(1)

while getopts $OPTSTR opt ; do
case $opt in
  d ) args="-P$OPTARG" ;;	# dest

  c ) symlink=n ;;		# make a copy

  m ) args="$args -m" ;;	# send mail after printing

  n ) args="$args -#$OPTARG" ;;	# number of copies

  q ) args="$args -C $OPTARG" ;; # priority (class)

  s ) true ;;		# suppress messages -- silently ignored

  t ) args="$args -T\"$OPTARG\"" ;; # title

  w ) echo "lp: write-after-printing (-$opt option) not supported!" 1>&2 ;;
  f ) echo "lp: forms (-$opt option) not supported!" 1>&2 ;;
  H ) echo "lp: special handling (-$opt option) not supported!" 1>&2 ;;
  P ) echo "lp: by-page printing (-$opt option) not supported!" 1>&2 ;;
  S ) echo "lp: character sets (-$opt option) not supported!" 1>&2 ;;
  y ) echo "lp: modes (-$opt option) not supported!" 1>&2 ;;

esac
done
shift `expr $OPTIND - 1`

if [ $symlink = y ] ; then
  args="$args -s"
fi

exec $PLP_DIR/lpr $args $*
