From 73c35eaccb52ae78f251e22626fcdc7e6e6b02f5 Mon Sep 17 00:00:00 2001 From: Sunshine Date: Tue, 14 Jul 2020 03:35:59 -0400 Subject: [PATCH] treat minus for output target file path as stdout --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5cfab69..aa54333 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,7 +26,7 @@ enum Output { impl Output { fn new(file_path: &str) -> Result { - 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)?))