Making a Script with switch as option

Hi all,

I want to make a script which should be able to use switch,
eg. If i want to perform a operation on a single file , i should give file path as argument
i.e. SCRIPT <PATH>

Now if i want to perform the same operation on a bunch of files, i should write as
SCRIPT -f filename
where filename contains path of files where operation is to be performed.
Now my question is how should i make it possible to use switch as argument.
I want to make this script in cshell. So is it possible that i can create such a script which should automatically understand that if i am using -f as switch it has to perform operation on group of files & should execute that code.

Similarly if i type, SCRIPT -h, it should execute the usage code.

Thanks in advance

Sarbjit

you can do something like:

while true
do
  case $1 in
        "")
            break
            ;;
        -h)
            ## help
            usage
	    exit
            ;;
        -f)
            filemane=$2
            if [ -s "$2" ]
            then
              echo "$Usage"
              exit 
            fi
            shift
            ;;
           
  esac
  shift
done

in bash u can do this by 'getopts' command:
the above code would like:

while getopts fh choice
do
  case $choice in
        -h)
            ## help
            usage
	    exit
            ;;
        -f)
            #do ur action with ,$2-$9 as the filepaths
             ;;
    ?) echo "wrong choice"
           
  esac
  
done

i don't know whether it is in csh or not.