Return path, smart print

This commit is contained in:
Mike Farah 2019-12-22 17:16:03 +11:00
parent 4fb44dbc47
commit 3d3eaf3034

2
yq.go
View File

@ -313,7 +313,7 @@ func printResults(matchingNodes []yqlib.MatchingNode, cmd *cobra.Command) error
for _, mappedDoc := range matchingNodes {
if mappedDoc.Node.Kind == yaml.ScalarNode {
cmd.Println(mappedDoc.Node.Value)
cmd.Print(mappedDoc.Node.Value)
} else {
var encoder = yaml.NewEncoder(cmd.OutOrStdout())
encoder.SetIndent(2)