(and would seg fault, too). solution: tell getopt to expect an argument, and set the appropriate flags when -w is given.