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

Feature: Add append to array

Adds the ability to append a value to an array instead of having to
know the index of the values within the array.

Resolves: #17
This commit is contained in:
kenjones
2017-09-23 20:21:16 -04:00
parent c17f8df8f8
commit c5f80a105d
8 changed files with 103 additions and 9 deletions

View File

@@ -44,6 +44,29 @@ b:
- new thing
```
### Appending value to an array field
Given a sample.yaml file of:
```yaml
b:
c: 2
d:
- new thing
- foo thing
```
then
```bash
yaml w sample.yaml b.d[+] "bar thing"
```
will output:
```yaml
b:
c: cat
d:
- new thing
- foo thing
- bar thing
```
### Updating files in-place
Given a sample.yaml file of:
```yaml