updating docs

This commit is contained in:
Mike Farah 2019-05-13 17:50:08 +10:00
parent a5f5fb2562
commit e5bcfedbe9
2 changed files with 81 additions and 0 deletions

View File

@ -32,6 +32,8 @@ bob:
cats: bananas
item2:
cats: apples
thing:
cats: oranges
```
then
```bash
@ -41,6 +43,29 @@ will output
```yaml
- bananas
- apples
- oranges
```
### Prefix Splat
Given a sample.yaml file of:
```yaml
---
bob:
item1:
cats: bananas
item2:
cats: apples
thing:
cats: oranges
```
then
```bash
yq r sample.yaml bob.item*.cats
```
will output
```yaml
- bananas
- apples
```
### Multiple Documents - specify a single document

View File

@ -43,6 +43,62 @@ b:
- new thing
```
### Splat
Given a sample.yaml file of:
```yaml
---
bob:
item1:
cats: bananas
item2:
cats: apples
thing:
cats: oranges
```
then
```bash
yq w sample.yaml bob.*.cats meow
```
will output:
```yaml
---
bob:
item1:
cats: meow
item2:
cats: meow
thing:
cats: meow
```
### Prefix Splat
Given a sample.yaml file of:
```yaml
---
bob:
item1:
cats: bananas
item2:
cats: apples
thing:
cats: oranges
```
then
```bash
yq w sample.yaml bob.item*.cats meow
```
will output:
```yaml
---
bob:
item1:
cats: meow
item2:
cats: meow
thing:
cats: oranges
```
### Appending value to an array field
Given a sample.yaml file of:
```yaml