The mustache substitution command line utility (like envsubst but for mustache templates).
sh
$ cargo install -f mustsubst
Say we want to populate a simple template file, with a single variable called name
(you can
find this exact file in tests/1.hello.mustache
.
mustache
Hello {{name}}!
We can read the template and replace name with the following command:
sh
$ mustsubst --arg name=World --file tests/1.hello.mustache
Hello World!
We can also read templates from stdin by specifying the file -
.
sh
$ echo Hello {{name}}! | mustsubst --arg name=World --file -
Hello World!
This is particularly useful if we want to parse multiple files at once. For example:
sh
$ cat tests/*.mustache | mustsubst --arg name=mustsubst --file -
Hello mustsubst!
mustsubst is awesome!
That's all the features we support right now!
At any time you can use --help to display help:
```sh $ mustsubst --help mustsubst 0.1.0 Daniel Mason daniel@danielmason.com
USAGE:
mustsubst [OPTIONS] --file
FLAGS: -h, --help Prints help information -V, --version Prints version information
OPTIONS:
--arg