diff --git a/README.md b/README.md index 6914c14..fa4d8de 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,15 @@ Command line tool that compiles Golang [templates](http://golang.org/pkg/text/template/) with values from YAML files. -Inspired by Python/Jinja2's [j2cli](https://github.com/kolypto/j2cli). +## Install global CLI -## Install - - go get github.com/tsg/gotpl +```shell +go install github.com/huantt/gotpl@latest +``` +```shell +export PATH=$PATH:$(go env GOPATH)/bin +``` ## Usage Say you have a `template` file like this: @@ -24,3 +27,14 @@ and a `user.yml` YAML file like this one: You can compile the template like this: gotpl template < user.yml + +Or +```shell +cat user.yaml | gotpl template +``` + +Use multiple value files +```shell +cat values-1.yaml values-2.yaml | gotpl template +# Note that end of value-1.yaml must be new line to separate with value-2.yaml +``` \ No newline at end of file