# Uncomment to debug as standalone script
# #!/usr/bin/tcsh
# set GETOPT="/usr/bin/getopt"

#
# Getopt for tcsh and wi,csh
#   Source: http://frodo.looijaard.name/project/getopt/misc/examples
#

set tempopt=(`"$GETOPT" -s tcsh -o n:p: -- $argv:q`)
if ($? != 0) then 
  echo "Terminating (tcsh getopt)..." >/dev/stderr
  exit 1
endif

eval set argv=\($tempopt:q\)

set getoptname = ""
set getoptproj = ""

while (1)
	switch($1:q)
	case -n:
                # echo "Option n, argument "\`$2:q\' 
                set getoptname = "$2:q"
                shift ; shift
		breaksw;
	case -p:
                # echo "Option p, argument "\`$2:q\' 
                set getoptproj = "$2:q"
                shift ; shift
		breaksw;
        case --:
		shift
		break
	default:
		echo "Internal error!" ; exit
	endsw
end

#echo "name = " "$getoptname"
#echo "project = " "$getoptproj"
