#!/bin/sh

# $Id: extractPlatforms,v 1.8 1995/02/16 14:51:34 svein Exp $

# Author: Svein Bøe, Ifi, Uio

testScript=0;
descrip=0;
plat=0;
help=0;
#xite_home="$XITE_HOME";
inFile="install_xite";
awkScript="./extractPlatforms.awk";

while test $# -gt 0
do
  case $1 in
    -t) testScript=1;;
    -d) descrip=1;;
    -p) plat=1;;
    -a) if test $# -le 1
	then
	  echo "$0: Argument missing for option $1.";
	  help=1; break
	fi
	shift
	awkScript=$1
	;;
    -*) help=1;;
    *)  inFile=$1;;
  esac
  shift
done

if test "$help" -eq 1
then
  echo "usage: extractPlatforms [-h | -t | -d | -p] [<filename>] ";
  echo "  -h         : Type this text.";
  echo "  -a <script>: Awk script (default ./extractPlatforms.awk).";
  echo "  -d         : Return textual description of alternative";
  echo "               platforms";
  echo "  -p         : Return names of platforms.";
  echo "  -t         : Make sh-script for testing platform type.";
  echo "  <filename> : Default is ./install_xite.";
  echo "Default for output is script for typing alternatives.";
  exit 1
fi

if test $# -gt 0
then
  inFile="$1"
fi

awk -f $awkScript testScript=$testScript descrip=$descrip \
	plat=$plat $inFile
