Cleaned up the pre-push code

Used fscanf to parse options.
Made it have only one exit point.