Properties encoder wip

This commit is contained in:
Mike Farah
2021-07-25 18:08:33 +10:00
parent b64982a487
commit 8c1a96d121
8 changed files with 78 additions and 27 deletions
+10 -1
View File
@@ -86,8 +86,17 @@ func evaluateAll(cmd *cobra.Command, args []string) error {
if nullInput && len(args) > 1 {
return errors.New("Cannot pass files in when using null-input flag")
}
// backwards compatibilty
if outputToJSON {
outputFormat = "json"
}
printer := yqlib.NewPrinter(out, outputToJSON, unwrapScalar, colorsEnabled, indent, !noDocSeparators)
format, err := yqlib.OutputFormatFromString(outputFormat)
if err != nil {
return err
}
printer := yqlib.NewPrinter(out, format, unwrapScalar, colorsEnabled, indent, !noDocSeparators)
if frontMatter != "" {
frontMatterHandler := yqlib.NewFrontMatterHandler(args[firstFileIndex])