Merge pull request #202 from snshn/minus-stdout

Treat - for stdout
This commit is contained in:
Sunshine 2020-07-14 03:51:18 -04:00 committed by GitHub
commit b98b7af0b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ enum Output {
impl Output {
fn new(file_path: &str) -> Result<Output, Error> {
if file_path.is_empty() {
if file_path.is_empty() || file_path.eq("-") {
Ok(Output::Stdout(io::stdout()))
} else {
Ok(Output::File(fs::File::create(file_path)?))