reset.c: extract function for parsing arguments