Revert to use cmdargs to do the command line parsing