orig/xyzimage.csh
author Axel Jacobs <axel@jaloxa.eu>
Mon, 14 Apr 2014 22:21:17 +0100
changeset 73 87fa3132a136
parent 0 0aa115157c9c
permissions -rw-r--r--
New IES test file with spaces in file name
     1 #!/bin/csh -f
     2 # RCSid: $Id: xyzimage.csh,v 2.5 2008/08/25 04:50:32 greg Exp $
     3 #
     4 # Display one or more CIE XYZE pictures using ximage
     5 #
     6 set popt=""
     7 if ( $?DISPLAY_PRIMARIES ) then
     8 	set popt="-p $DISPLAY_PRIMARIES"
     9 endif
    10 set xiargs=""
    11 set i=1
    12 set firstarg=0
    13 while ( $i <= $#argv && ! $firstarg )
    14 	@ i1= $i + 1
    15 	switch ( $argv[$i] )
    16 	case -ge*:
    17 	case -di*:
    18 	case -g:
    19 	case -c:
    20 	case -e:
    21 		if ( $i1 > $#argv ) goto notenough
    22 		set xiargs=($xiargs $argv[$i] $argv[$i1])
    23 		@ i1++
    24 		breaksw
    25 	case -d:
    26 	case -b:
    27 	case -m:
    28 	case -f:
    29 	case -s:
    30 	case =*:
    31 	case -o*:
    32 		set xiargs=($xiargs $argv[$i])
    33 		breaksw
    34 	case -p:
    35 		set popt="-p"
    36 		while ( $i1 <= $i + 8 )
    37 			if ( $i1 > $#argv ) goto notenough
    38 			set popt="$popt $argv[$i1]"
    39 			@ i1++
    40 		end
    41 		breaksw
    42 	case -*:
    43 		echo "Unknown option: $argv[$i]"
    44 		exit 1
    45 	default:
    46 		set firstarg=$i
    47 		breaksw
    48 	endsw
    49 	set i=$i1
    50 end
    51 set ecode=1
    52 onintr quit
    53 set td=`mktemp -d /tmp/xyz.XXXXXX`
    54 if ( ! $firstarg ) then
    55 	ra_xyze -r -u $popt > $td/stdin
    56 	if ( $status ) goto quit
    57 else
    58 	set i=$firstarg
    59 	while ( $i <= $#argv )
    60 		ra_xyze -r -u $popt $argv[$i] $td/$argv[$i]:t
    61 		if ( $status ) goto quit
    62 		@ i++
    63 	end
    64 endif
    65 ximage $xiargs $td/*
    66 set ecode=$status
    67 quit:
    68 	rm -rf $td
    69 	exit $ecode
    70 notenough:
    71 	echo "Missing arguments for $argv[$i] option"
    72 	exit 1