Skip to content

Commit c22394b

Browse files
author
Mike Farah
committed
Updated readme
1 parent b1ff470 commit c22394b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ go get github.com/mikefarah/yaml
1919
- Create a yaml file given a script file
2020
- Convert from json to yaml
2121
- Convert from yaml to json
22+
- Pipe data in by using '-'
2223

2324
## Read examples
2425
```
@@ -132,6 +133,11 @@ b:
132133
c: cat
133134
```
134135
136+
### Update from STDIN
137+
```bash
138+
cat sample.yaml | yaml w - b.c blah
139+
```
140+
135141
### Adding new fields
136142
Any missing fields in the path will be created on the fly.
137143

@@ -191,6 +197,11 @@ b:
191197
- name: Howdy Partner
192198
```
193199
200+
And, of course, you can pipe the instructions in using '-':
201+
```bash
202+
cat update_instructions.yaml | yaml w -s - sample.yaml
203+
```
204+
194205
## New Examples
195206
Yaml files can be created using the 'new' command. This works in the same way as the write command, but you don't pass in an existing Yaml file.
196207

@@ -225,6 +236,12 @@ b:
225236
- name: Howdy Partner
226237
```
227238
239+
You can also pipe the instructions in:
240+
241+
```bash
242+
cat create_instructions.yaml | yaml n -s -
243+
```
244+
228245
## Converting to and from json
229246

230247
### Yaml2json

0 commit comments

Comments
 (0)