Fix reordering into main(); use cmdline.py to get arguments.