Updated readme

This commit is contained in:
Mike Farah 2017-04-12 21:30:29 +10:00
parent b1ff47022b
commit c22394b540

View File

@ -19,6 +19,7 @@ go get github.com/mikefarah/yaml
- Create a yaml file given a script file - Create a yaml file given a script file
- Convert from json to yaml - Convert from json to yaml
- Convert from yaml to json - Convert from yaml to json
- Pipe data in by using '-'
## Read examples ## Read examples
``` ```
@ -132,6 +133,11 @@ b:
c: cat c: cat
``` ```
### Update from STDIN
```bash
cat sample.yaml | yaml w - b.c blah
```
### Adding new fields ### Adding new fields
Any missing fields in the path will be created on the fly. Any missing fields in the path will be created on the fly.
@ -191,6 +197,11 @@ b:
- name: Howdy Partner - name: Howdy Partner
``` ```
And, of course, you can pipe the instructions in using '-':
```bash
cat update_instructions.yaml | yaml w -s - sample.yaml
```
## New Examples ## New Examples
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. 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.
@ -225,6 +236,12 @@ b:
- name: Howdy Partner - name: Howdy Partner
``` ```
You can also pipe the instructions in:
```bash
cat create_instructions.yaml | yaml n -s -
```
## Converting to and from json ## Converting to and from json
### Yaml2json ### Yaml2json