This commit is contained in:
Mike Farah 2022-12-17 11:16:27 +11:00
parent cdc91e518f
commit 663713c288
2 changed files with 4 additions and 0 deletions

View File

@ -247,6 +247,7 @@ Note the use of `...` to ensure key nodes are included.
Given a sample.yml file of: Given a sample.yml file of:
```yaml ```yaml
# hi # hi
a: cat # comment a: cat # comment
# great # great
b: # key comment b: # key comment
@ -265,6 +266,7 @@ b:
Given a sample.yml file of: Given a sample.yml file of:
```yaml ```yaml
# welcome! # welcome!
a: cat # meow a: cat # meow
# have a great day # have a great day
``` ```
@ -293,6 +295,7 @@ yq '. | head_comment' sample.yml
will output will output
```yaml ```yaml
welcome! welcome!
``` ```
## Head comment with document split ## Head comment with document split

View File

@ -127,6 +127,7 @@ Like pick but recursive. This uses `ireduce` to deeply set the selected paths in
Given a sample.yml file of: Given a sample.yml file of:
```yaml ```yaml
parentA: bob parentA: bob
parentB: parentB:
child1: i am child1 child1: i am child1