2022-10-28 03:16:46 +00:00
|
|
|
package yqlib
|
|
|
|
|
|
|
|
type YamlPreferences struct {
|
2024-02-24 04:36:16 +00:00
|
|
|
Indent int
|
|
|
|
ColorsEnabled bool
|
2022-10-28 03:16:46 +00:00
|
|
|
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,
|
2022-10-28 03:16:46 +00:00
|
|
|
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,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-28 03:16:46 +00:00
|
|
|
var ConfiguredYamlPreferences = NewDefaultYamlPreferences()
|