Factor and test argument parser for migration scripts.

* Fix `path` argument.
DRY argument parsing in migration scripts.