mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 10:04:43 +08:00
Can now splat maps
This commit is contained in:
@@ -33,6 +33,26 @@ cat sample.yaml | yaml - b.c
|
||||
```
|
||||
will output the value of '2'.
|
||||
|
||||
### Splat
|
||||
Given a sample.yaml file of:
|
||||
```yaml
|
||||
---
|
||||
bob:
|
||||
item1:
|
||||
cats: bananas
|
||||
item2:
|
||||
cats: apples
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yaml sample.yaml bob.*.cats
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
- bananas
|
||||
- apples
|
||||
```
|
||||
|
||||
### Handling '.' in the yaml key
|
||||
Given a sample.yaml file of:
|
||||
```yaml
|
||||
@@ -82,6 +102,8 @@ will output:
|
||||
- sam
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Updating yaml
|
||||
Given a sample.yaml file of:
|
||||
```yaml
|
||||
|
||||
Reference in New Issue
Block a user