yq/Upgrade Notes

57 lines
1.3 KiB
Plaintext
Raw Normal View History

2020-01-05 21:12:30 +00:00
2020-01-05 04:28:24 +00:00
# New Features
- Keeps yaml comments and formatting (string blocks are saved, number formatting is preserved, so it won't drop off trailing 0s for values like 0.10, which is important when that's a version entry )
- Handles anchors! (doc link)
2020-01-08 21:17:56 +00:00
- Can specify yaml tags (e.g. !!int), quoting values no longer sufficient, need to specify the tag value instead.
- Can print out matching paths and values when splatting (doc link)
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.
- Deep splat (**) to match arbitrary paths, (doc link)
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.
## 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
```
yq r sample.yaml 'parent.*.there*'
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-05 04:28:24 +00:00
# Merge command
2020-01-10 11:01:59 +00:00
- New flag 'autocreates' missing entries in target by default, new flag to turn that off.
2020-01-05 04:28:24 +00:00