1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00

Can assign-update comments

This commit is contained in:
Mike Farah
2021-01-06 20:22:50 +11:00
parent fbf36037c9
commit 2e81384eed
9 changed files with 113 additions and 23 deletions

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