mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-07 02:48:27 +08:00
Return path, smart print
This commit is contained in:
+2
-2
@@ -15,7 +15,7 @@ type UpdateCommand struct {
|
||||
|
||||
type YqLib interface {
|
||||
DebugNode(node *yaml.Node)
|
||||
Get(rootNode *yaml.Node, path string) (*yaml.Node, error)
|
||||
Get(rootNode *yaml.Node, path string) ([]MatchingNode, error)
|
||||
Update(rootNode *yaml.Node, updateCommand UpdateCommand) error
|
||||
New(path string) yaml.Node
|
||||
}
|
||||
@@ -38,7 +38,7 @@ func (l *lib) DebugNode(node *yaml.Node) {
|
||||
navigator.DebugNode(node)
|
||||
}
|
||||
|
||||
func (l *lib) Get(rootNode *yaml.Node, path string) (*yaml.Node, error) {
|
||||
func (l *lib) Get(rootNode *yaml.Node, path string) ([]MatchingNode, error) {
|
||||
var paths = l.parser.ParsePath(path)
|
||||
navigator := NewDataNavigator(l.log, true)
|
||||
return navigator.Get(rootNode, paths)
|
||||
|
||||
Reference in New Issue
Block a user