yq/pkg/yqlib/yaml.go

35 lines
997 B
Go
Raw Normal View History

package yqlib
type YamlPreferences struct {
2024-02-24 04:36:16 +00:00
Indent int
ColorsEnabled bool
LeadingContentPreProcessing bool
PrintDocSeparators bool
UnwrapScalar bool
EvaluateTogether bool
}
func NewDefaultYamlPreferences() YamlPreferences {
return YamlPreferences{
2024-02-24 04:36:16 +00:00
Indent: 2,
ColorsEnabled: true,
LeadingContentPreProcessing: true,
PrintDocSeparators: true,
UnwrapScalar: true,
EvaluateTogether: false,
}
}
2024-02-24 04:36:16 +00:00
func (p *YamlPreferences) Copy() YamlPreferences {
return YamlPreferences{
Indent: p.Indent,
ColorsEnabled: p.ColorsEnabled,
LeadingContentPreProcessing: p.LeadingContentPreProcessing,
PrintDocSeparators: p.PrintDocSeparators,
UnwrapScalar: p.UnwrapScalar,
EvaluateTogether: p.EvaluateTogether,
}
}
var ConfiguredYamlPreferences = NewDefaultYamlPreferences()