regenerate config with -regenerate

instead of commenting and uncommenting code, just use -regenerate
argument passed in by command line.