Can assign-update comments

This commit is contained in:
Mike Farah
2021-02-11 10:58:40 +11:00
parent fbf36037c9
commit 2e81384eed
9 changed files with 113 additions and 23 deletions
+16
View File
@@ -13,6 +13,22 @@ will output
a: cat # single
```
## Use update assign to perform relative updates
Given a sample.yml file of:
```yaml
a: cat
b: dog
```
then
```bash
yq eval '.. lineComment |= .' sample.yml
```
will output
```yaml
a: cat # cat
b: dog # dog
```
## Set head comment
Given a sample.yml file of:
```yaml