[8866] in Athena Bugs

home help back first fref pref prev next nref lref last post

patch for xdpr

daemon@ATHENA.MIT.EDU (brlewis@Athena.MIT.EDU)
Wed Jan 22 13:30:14 1992

From: brlewis@Athena.MIT.EDU
Date: Wed, 22 Jan 92 13:29:58 -0500
To: bugs@Athena.MIT.EDU

From the man page:
     Any other arguments will be passed to the xwd(1), xpr(1),
     and lpr(1) commands as appropriate for each.

Not true.  Those options which xdpr *knows* belong to xwd or xpr will be
passed to those programs.  Any other option will be passed to lpr.  This
was a problem for me, as I was trying to use the -frame option to xwd.

This patch makes xdpr understand other options as well; most notably the
-output option to xpr, which allows creation of postscript files.

*** /usr/athena/xdpr	Mon Jul  2 16:03:14 1990
--- /tmp/xdpr	Wed Jan 22 13:28:01 1992
***************
*** 34,39 ****
--- 34,40 ----
  
  # ...arguments to xwd...
  
+ 		case -frame:
  		case -nobdrs:
  		case -root:
  		case -xy:
***************
*** 45,50 ****
--- 46,52 ----
  # Note: xwd -font <font> is not implemented at this time
  		case -display:
  		case -out:
+ 		case -add:
  			set xwdv = ($xwdv $i $argv[2])
  			shift argv
  			breaksw
***************
*** 56,61 ****
--- 58,65 ----
  		case -width:
  		case -left:
  		case -top:
+ 		case -output:
+ 		case -append:
  		case -split:
  		case -device:
  			set xprv = ($xprv $i $argv[2])
***************
*** 74,79 ****
--- 78,86 ----
  		case -rv:
  		case -compact:
  		case -noff:
+ 		case -psfig:
+ 		case -noposition:
+ 		case -slide:
  			set xprv = ($xprv $i)
  			breaksw
  # ...arguments to lpr...
***************
*** 115,121 ****
  		exit 0
  	endif
  
! # dump only
  	if ("$xwdv" =~  *-out*) then
  		if ("$xprv" !~ "" || "$lprv" !~ "") then
  			echo "xdpr: The following arguments will be ignored:"
--- 122,128 ----
  		exit 0
  	endif
  
! # X window dump only
  	if ("$xwdv" =~  *-out*) then
  		if ("$xprv" !~ "" || "$lprv" !~ "") then
  			echo "xdpr: The following arguments will be ignored:"
***************
*** 122,127 ****
--- 129,144 ----
  			echo $xprv $lprv
  		endif
  		xwd $xwdv
+ 		exit 0
+ 	endif
+ 
+ # xpr file dump only 
+ 	if ("$xprv" =~  *-output* || "$xprv" =~ *-append*) then
+ 		if ("$lprv" !~ "") then
+ 			echo "xdpr: The following arguments will be ignored:"
+ 			echo $lprv
+ 		endif
+ 		xwd $xwdv | xpr -header "$header" -trailer "$trailer" $xprv
  		exit 0
  	endif
  

home help back first fref pref prev next nref lref last post