Refactoring Yaml encoder prefs

This commit is contained in:
Mike Farah
2024-02-24 15:36:16 +11:00
parent f44d47a204
commit 7a01e216c4
21 changed files with 103 additions and 86 deletions
+4 -1
View File
@@ -21,7 +21,10 @@ func configureEncoder(format *PrinterOutputFormat, indent int) Encoder {
case TSVOutputFormat:
return NewCsvEncoder(ConfiguredTsvPreferences)
case YamlOutputFormat:
return NewYamlEncoder(indent, false, ConfiguredYamlPreferences)
var prefs = ConfiguredYamlPreferences.Copy()
prefs.Indent = indent
prefs.ColorsEnabled = false
return NewYamlEncoder(prefs)
case XMLOutputFormat:
var xmlPrefs = ConfiguredXMLPreferences.Copy()
xmlPrefs.Indent = indent