getopt_long() requires a null entry at the end of the longopts array. It also reports an error already when some switch is wrong, so just exit silently when we get an unexpected value.