treat minus for output target file path as stdout

This commit is contained in:
Sunshine 2020-07-14 03:35:59 -04:00
parent c1fec5967d
commit 73c35eaccb
No known key found for this signature in database
GPG key ID: B80CA68703CD8AB1

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)?))