in reply to Re^2: GetOpt ignore required arguments
in thread GetOpt ignore required arguments

Yes, the idea that an option like "-a" sometimes has an arg and sometimes not, does present problems...
[ -a [optional_arg ] ] Here -a is optional and its arg is optional (if there is a -a option).

I personally would try to organize the UI so that each -option either has >= 1 args or no args. But I'm happy that you have a solution that works for your case! Thanks for reporting back on what worked for you!