Add a common --wait-secs option, fix an arg-parsing bug, and simplify arg parsing.