Write my own option parsing.

    getopt() isn't really portable: it has different and annoying
    behaviors on OSX, and doesn't actually exist on plan9.