From 9d8d5d68ab0e6b70d026b5f0a487a4750789599e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Fernando=20Carri=C3=B3n?= Date: Fri, 27 Oct 2023 14:02:38 +0200 Subject: [PATCH] improve README and help --- README.md | 31 ++++++++++++++++++++++++------- main.go | 10 +++++----- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c4e8c9b..6332bc8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,20 @@ # spry -Basic [Sprig](https://masterminds.github.io/sprig/) Template Rendering. +Basic [Sprig](https://masterminds.github.io/sprig/) & +[Helm Templating Language (HTL)](https://helm.sh/docs/howto/charts_tips_and_tricks/#know-your-template-functions) +Template Rendering Tool. + +It's design emulates how the `helm template` command runs, for rendering simple +Go Templates, Sprig extended Go Templates, or Helm Templating Language (HTL) +Templates, outside of a Helm Chart. + +It takes provided templates and renders them using provided values. + +### _ Files + +Like with `helm template` template files whose names begins with `_` will not +produce output, but are used to provide common code used in other template +files. ## Usage Examples @@ -18,17 +32,20 @@ Usage of ./spry [Options] [Template Files]: -fp string Prefix for the filename in the output. (default "# ") -helm - Use Helm templating language (superset of Sprig). + Use the Helm Templating Language (HTL) (a superset of Sprig). -helmDNS - When using Helm Tpl Lang, support DNS resolution. (default true) - -helmLint - When using Helm Tpl Lang, enable the Linting Mode. + When using HTL, support DNS resolution. (default true) + -helmLin + When using HTL, enable the Linting Mode. -helmNestValues - When using Helm Tpl Lang, Nest provided values under '.Values' (default true) + When using HTL, Nest provided values under '.Values' (default true) -helmStrict - When using Helm Tpl Lang, use strict rendering. + When using HTL, use strict rendering. -set value Set a specific value (foo.bar=spam) + -v Print the version and exit. + -version + Print the version and exit. Template Files can also be directories to recurse for templates. diff --git a/main.go b/main.go index ca9006c..8c91527 100644 --- a/main.go +++ b/main.go @@ -82,27 +82,27 @@ func init() { flag.BoolVar( &flags.helm, "helm", false, - "Use Helm templating language (superset of Sprig).", + "Use the Helm Templating Language (HTL) (a superset of Sprig).", ) flag.BoolVar( &flags.helmStrict, "helmStrict", false, - "When using Helm Tpl Lang, use strict rendering.", + "When using HTL, use strict rendering.", ) flag.BoolVar( &flags.helmDNSFunc, "helmDNS", true, - "When using Helm Tpl Lang, support DNS resolution.", + "When using HTL, support DNS resolution.", ) flag.BoolVar( &flags.helmLint, "helmLint", false, - "When using Helm Tpl Lang, enable the Linting Mode.", + "When using HTL, enable the Linting Mode.", ) flag.BoolVar( &flags.helmNestValues, "helmNestValues", true, - "When using Helm Tpl Lang, Nest provided values under '.Values'", + "When using HTL, Nest provided values under '.Values'", ) flag.StringVar( &flags.outputFilenamePrefix,