From dc19c4c813f019afc3d73b29abbb283d344a5ff1 Mon Sep 17 00:00:00 2001 From: Damian Date: Fri, 24 Nov 2023 21:25:12 +0000 Subject: [PATCH] output to stdout by default --- cmd/main.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 8ed3b1a..d28787d 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -68,10 +68,15 @@ func main() { // utility cli flag to compile ruleset directory into single ruleset.yaml if *mergeRulesets || *mergeRulesetsGzip { - output, err := os.Create(*mergeRulesetsOutput) - if err != nil { - fmt.Println(err) - os.Exit(1) + output := os.Stdout + + if *mergeRulesetsOutput != "" { + output, err = os.Create(*mergeRulesetsOutput) + + if err != nil { + fmt.Println(err) + os.Exit(1) + } } err = cli.HandleRulesetMerge(*ruleset, *mergeRulesets, *mergeRulesetsGzip, output)