#!/bin/csh

# TEXTWIN - a c-shell script (version 30 Oct 94)
# Start textedit with a specified fontsize

# Set default parameters
set FONTLIB = /usr/lib/fonts/fixedwidthfonts
set FONTSIZE = 18
set FONTNAME = cour.b
set FILENAME = ""

#####################################################################
# Read options from the command line and set parameters
####################################################################
set numargs = $#argv
if ($numargs != 0) then
  #---------------------------------------------------
  #parameters given in command line
  set mode  = command
  set index = 1
  while ($index <= $numargs) 
   set a = $argv[$index]
   switch ($a)
     case "-s":
       @ index++
       set FONTSIZE = $argv[$index] 
       breaksw
     case "-h":
       echo 'Usage: textwin [-s fontsize | -h]'
       exit
      breaksw
     default:
      set FILENAME = $a
     endsw
     @ index++
  end #while
endif

#####################################################################
# Run the window in the background.
####################################################################
textedit -Wt $FONTLIB/$FONTNAME.$FONTSIZE $FILENAME &