Command-line option parser similar to getopt.