Factor out getting command-line args, and test it.