Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Farah committed Apr 12, 2017
1 parent b1ff470 commit c22394b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ go get github.com/mikefarah/yaml
- Create a yaml file given a script file
- Convert from json to yaml
- Convert from yaml to json
- Pipe data in by using '-'

## Read examples
```
Expand Down Expand Up @@ -132,6 +133,11 @@ b:
c: cat
```
### Update from STDIN
```bash
cat sample.yaml | yaml w - b.c blah
```

### Adding new fields
Any missing fields in the path will be created on the fly.

Expand Down Expand Up @@ -191,6 +197,11 @@ b:
- 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
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.

Expand Down Expand Up @@ -225,6 +236,12 @@ b:
- name: Howdy Partner
```
You can also pipe the instructions in:
```bash
cat create_instructions.yaml | yaml n -s -
```

## Converting to and from json

### Yaml2json
Expand Down

0 comments on commit c22394b

Please sign in to comment.