getopt help

scriptname [ -l n ] [ -f n ] [ -s name ] [ -d name ]
[ -b name age ] [ -c ]

i have made a script to perform so tasks and i managed to complete the tasks for all the options

the problem i am facing is that i can run the scripts individually but i would like to make it such that it can accept multiple options and give me the appropriate output

e.g. scriptname -f 2 -s joe
and it gives me the output for the two option i have specified. i know i can use getopt but not sure how to apply it

while getopts l:s:f:d:b:c par
do
case $par in
l) num=$OPTARG;;
s) name=$OPTARG;;
f) num2=$OPTARG;;
d) name2=$OPTARG;;
b) name_age=$OPTARG;; #you have to reformat this to get name & age seperately.
c) flag=1;;
*) echo "Wrong Usage"; exit -1;
esac
done