yq/Upgrade Notes

74 lines
1.9 KiB
Plaintext
Raw Normal View History

2020-01-05 21:12:30 +00:00
2020-01-10 22:55:24 +00:00
Major release! Upgraded underlying yaml parser, re-written majority of yq. This has brought on a number of features that have been in demand for a while (see below).
This is in beta and needs some community feedback and testing :)
2020-01-05 04:28:24 +00:00
# New Features
2020-01-10 22:55:24 +00:00
- Keeps yaml comments and formatting, can specify yaml tags when updating. https://github.com/mikefarah/yq/issues/19, https://github.com/mikefarah/yq/issues/169, https://github.com/mikefarah/yq/issues/107, https://github.com/mikefarah/yq/issues/171, https://github.com/mikefarah/yq/issues/245, https://github.com/mikefarah/yq/issues/303,https://github.com/mikefarah/yq/issues/308,https://github.com/mikefarah/yq/issues/314
- Handles anchors! https://github.com/mikefarah/yq/issues/310, https://github.com/mikefarah/yq/issues/178
- Can print out matching paths and values when splatting https://github.com/mikefarah/yq/issues/20
2020-01-10 11:01:59 +00:00
- JSON output works for all commands! Yaml files with multiple documents are printed out as one JSON document per line.
2020-01-10 22:55:24 +00:00
- Deep splat (**) to match arbitrary paths
2020-01-05 04:28:24 +00:00
# Breaking changes
## Update scripts file format has changed to be more powerful.
Comments can be added, and delete commands have been introduced.
2020-01-10 22:55:24 +00:00
Before:
```yaml
b.e[+].name: Mike Farah
```
After:
```yaml
- command: update
path: b.e[+].thing
value:
#great
things: frog # wow!
- command: delete
path: b.d
```
https://github.com/mikefarah/yq/issues/305
## Reading and splatting, matching results are printed once per line.
e.g:
```json
parent:
childA:
no: matches here
childB:
there: matches
hi: no match
there2: also matches
```
2020-01-10 22:55:24 +00:00
```bash
yq r sample.yaml 'parent.*.there*'
2020-01-10 22:55:24 +00:00
```
old
```yaml
- null
- - matches
- also matches
```
new
```yaml
matches
also matches
```
and you can print the matching paths:
yq r --printMode pv sample.yaml 'parent.*.there*'
```yaml
parent.childB.there: matches
parent.childB.there2: also matches
2020-01-10 22:55:24 +00:00
```