Add command-line dumping and restoring from a state file.