Use getopt to parse arguments.

(Not that this is important by any means, but it's a long-standing paper cut to me, and gives me more time to spin my wheels thinking about blocking syscalls ;).)