using getopts

Hi,
I have a program where I want to use getopts.
I want to use "-i" option and then optionally supply arguments.
If user dosent supply arguments, then also it should work.
Please tell me how to proceed.
Here is some code, this is not right code btw but a sample to understand what I want to do:

while getopts :tui:c:p: swtch
        do
                case $swtch in
                        u) echo "Un-installing feature is under development.";;
                        i)
                                echo $OPTARG
                                if [[ $OPTARG = "" ]]
                                then
                                      ValidateInput
                                else
                                       ValidateInput ${OPTARG}
                       \?) usage ;;
                esac
        done
        shift $(($OPTIND -1))
      

Remove the ':' from after the 'i' in your list of command line switches.
Its all explained in the man page for getopts