Parse command line arguments.

Only basic validation is done, but that should be fine for this use case.