Handeling multiple options in script

i need to be able to handel if multiple commands are passed into my script.
(ie) [scriptname] -f -r -i [filename].
does anyone know a simple solution to handeling this. Thanks

man getopts

http://www.well.ox.ac.uk/~johnb/comp/unix/ksh.html\#commandlineargs

http://quong.best.vwh.net/shellin20/\#LtohTOCentry-31