A CLI for mustache.java with enhanced JSON support
If you dont have gradle installed the gradle wrapper (gradlew) will install gradle and all necessary components then run as if the "gradle" command were run.
The following builds and creates an install directory in build/install/mustache-cli
sh ./gradlew installDist
gradlew installDist
Include installation directory/bin in your PATH or call mustache-cli explicitly
build/install/mustache-cli or mustache-cli
Note that the default run script generated by gradle is quite verbose in order to be environment agnostic. You can edit it or create a new one sets the classspath and invokes the Main class org.xmlsh.tools.mustache.cli.main.Main
java -cp <lib/*> org.xmlsh.tools.mustache.cli.main.Main [ options ]
mustache-cli [options]
Option | Arg | Description |
---|---|---|
--root | -R | --template-dir | dirname | Template directory root |
-f | --template-file | filename | Template file or '-' |
-t | --template | --template-data | 'text' | Template data inline |
-p | --properties-file | filename | Context read from Java properties file" |
-j | --json-data | filename | Context inline as JSON" |
-J | --json-file | filename | Context read from JSON file" |
-o | --output | --output-file | filename | Write to output file or '-'" |
-n | --name | filename | Template name |
-S | --delim-start | "string" | Delmitar start string [default '{{'] |
-E | --delim-end dirname | Delmitar end string [default '}}'] | |
--json | Use JSON encoded data for variable expansion | |
--html | Use HTML encoded data for variable expansion | |
-h | --help | Help |
Supports the common gradle tasks for application, java etc. run
gradle :tasks for a list of tasks or
gradle --help
for a list of options.
gradle distTar # creates a tar distribution
gradle distZip # creates a zip distribution
See hhttp://gradle.org/docs/current/userguide/userguide.html for common gradle usage