#!/bin/csh

if ( $#argv != 2 ) then
    echo "Usage: createSwitch <SwitchType> <SwitchName>"
    exit 1
endif

if !( $1 == "Switch" | $1 == "SwitchOnOff" ) then
    echo "$1 must be Switch or SwitchOnOff"
    exit 1
endif

set file = $2.cfg
if ( -e $file ) then
	echo "Removing existing file $file"
 	rm $file
endif

echo "Creating file $file"
touch $file
echo $2 >> $file
echo '{' >> $file
echo '    type                '$1';' >> $file
echo '    description         "'$2'?";'  >> $file
echo '    iconURL             "/FoamX/icons/small/maths/Switch.gif";'  >> $file
echo '}' >> $file

