Add support for rewriting files from commandline