help in getopts

hey

need help with getopts again.

i am using getopts to read my command line options and arguments. i can manage to do for options that have only one argument

e.g srcipt_name -f 3

i am able to use getopts to do this but i am having problems two accept more than two agruments
e.g. script_name -d joe 2005

i am having problems capturing the second argument. i can only capture joe using OPTARG but i cant capture 2005. i need to capture the two arguments for option d. pls need help

thanx alot

I they are both arguments to option -d, then enclose in double quotes...

script_name -d "joe 2005"

Cheers
ZB