Command line inputs validation

Hi,
I have a script called read.sh that takes a file as input. Now I want to make that script take the file as input with a -f option preceding the filename. How can I do this validation. How can I find whether the given option is -f or not inside the script.

Thanks in advance

Use getopts

one more is direct argument validation....

as ,

if [ $1 = "-f" ]
then
echo "yes"
else
echo "no"
fi

something like that !!!...