Change cli to write files instead of priting results.