Merge "Refactor options parsing in dumpstate"