I found myself grinning while reading the Mac OS X getopt() man page:
A single dash “-” may be specified as a character in optstring, however it should never have an argument associated with it. This allows getopt() to be used with programs that expect “-” as an option flag. This practice is wrong, and should not be used in any current development.
It is also possible to handle digits as option letters. This allows getopt() to be used with programs that expect a number (“-3”) as an option. This practice is wrong, and should not be used in any current development.
Yeah!! The eternal war of right against wrong, good against evil, playing out in nasty getopt() extensions.
Of course, Mac OS X getopt() also uses the evil non-standard optreset (although the optind = 0 solution is hardly more elegant). I am hacking around trying to find a way to run getopt() twice in a portable manner without barfing every time I read the code. Current best of breed solutions look something like this:
And re: Vonage replacement: I just unplugged the Vonage box for now, which effectively turns it into a really expensive forwarding service.