Fixing comments

This commit is contained in:
Mike Farah
2021-11-24 10:59:19 +11:00
parent c2808dc6c1
commit 7e09a66b0b
5 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -139,7 +139,7 @@ will output
welcome!
```
##
## Head comment with document split
Given a sample.yml file of:
```yaml
# welcome!
+3
View File
@@ -0,0 +1,3 @@
# Parent
Parent simply returns the parent nodes of the matching nodes.
+7 -1
View File
@@ -1,3 +1,6 @@
# Parent
Parent simply returns the parent nodes of the matching nodes.
## Simple example
Given a sample.yml file of:
@@ -14,13 +17,15 @@ will output
nested: cat
```
## Show parent
## Parent of nested matches
Given a sample.yml file of:
```yaml
a:
fruit: apple
name: bob
b:
fruit: banana
name: sam
```
then
```bash
@@ -29,6 +34,7 @@ yq eval '.. | select(. == "banana") | parent' sample.yml
will output
```yaml
fruit: banana
name: sam
```
## No parent