Add `to-file` option to write to file