Set up command line options, distinguish between test mode and file mode