added output-file option (doesnt work with /dev/null)