#!/bin/csh -f
#!/bin/csh -fxv
# This is a sample of a getopt part of a script.
while ( $#argv > 0 )
	if ( "$1" !~ -* ) break
	set a=$1
	shift
	set a = `echo $a | cut -c 2-`  #Strip the "-"
#	echo $a; exit
	while ( $a != "" )
		set f = `echo $a | cut -c 1`
		switch ( $f )
			case 'x':
				echo x is a known flag
				#more stuff
			breaksw
			case 'f':
				echo f means a file name follows
				if ( $#argv > 0 ) then
					set fil = $1
					shift
				endif
				echo $fil should be tested for readability
				break
			breaksw
			default:
				echo other stuff $f
			breaksw
		endsw
		set a=`echo $a | cut -c 2-`
	end
end
while ( $#argv > 0 )
	echo $argv[1] should be a file.
	shift
end
