This commit is contained in:
Mike Farah
2020-02-28 14:03:40 +11:00
parent f91093d5fe
commit 10029420a5
4 changed files with 166 additions and 0 deletions
+13
View File
@@ -128,6 +128,19 @@ func explode(matchingNodes []*yqlib.NodeContext) error {
return nil
}
func convertToLength(node *yaml.Node) *yaml.Node {
switch kindToCheck {
case yaml.ScalarNode:
return len(node.Value)
case yaml.MappingNode:
return len(node.Content) / 2
default:
return len(node.Content)
}
}
func printResults(matchingNodes []*yqlib.NodeContext, writer io.Writer) error {
if prettyPrint {
setStyle(matchingNodes, 0)