getopt itself will add a --. You can check the command:
Code:
getopt -q ab:c <args>
and you will see the result will contain an additional -- (again, left side the options, right side the additional arguments).
in your case therefore you need to handle that -- too.
Insert
set -xv at the beginning of your script and you will see what's really happening.