Improve parsing of prm/cmd files