Firstly:
Code:
while (( "$#" > "0" ))
This a numeric comparison and not a string one so none of the quotes are required.
Secondly, when you have no arguments the loop will enter once for the '--' argument and perform the shift. This then sets $# = 0 so the loop exits.
Remember your loop only caters for incorrect entries to exit and not for none.
I think you need to test for number options passed in prior to the getopts loops.
Hope that helps.