Skip to content

Commit

Permalink
updated readme and command help (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
belitre authored Jan 20, 2019
1 parent 085808d commit e0d1dd9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,41 @@ You can download gotpl binaries for windows, linux and mac from here: https://gi

Say you have a `template` file like this:

```
{{.first_name}} {{.last_name}} is {{.age}} years old.
```

and a `user.yml` YAML file like this one:

```
first_name: Max
last_name: Mustermann
age: 30
```

You can compile the template like this:

```
gotpl template -f user.yml
```

You can compile multiple templates at the same time like this (__warning: gotpl will generate a single ouput for all the templates!__):

```
gotpl template other_template -f user.yml
```

You can set values though the command line too:

gotpl template -f user.yam --set age=40
```
gotpl template -f user.yaml --set age=40
```

You can get help about how to use the command running:

```
gotpl -h
```

## Development

Expand Down
2 changes: 1 addition & 1 deletion commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var rootCmd = &cobra.Command{
Use: "gotpl template_file",
Use: "gotpl template_file1 template_file2 ...",
Short: "CLI tool for Golang templates",
Long: `gotpl - CLI tool for Golang templates
https://github.com/belitre/gotpl
Expand Down

0 comments on commit e0d1dd9

Please sign in to comment.