From 3461e45d64fc02f462ade0163fdbfd10cc8d9735 Mon Sep 17 00:00:00 2001 From: dustin deus Date: Thu, 12 Apr 2018 14:05:17 +0200 Subject: [PATCH] add to lower and upper string helper, dump version --- commands/template/template.go | 2 ++ docs/templateSyntax.md | 2 ++ main.go | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/template/template.go b/commands/template/template.go index 96dd4b7..41976b1 100644 --- a/commands/template/template.go +++ b/commands/template/template.go @@ -114,6 +114,8 @@ func New(options ...Option) *Templating { "index": strings.Index, "repeat": strings.Repeat, "split": strings.Split, + "toLower": strings.ToLower, + "toUpper": strings.ToUpper, // path "joinPath": filepath.Join, "relPath": filepath.Rel, diff --git a/docs/templateSyntax.md b/docs/templateSyntax.md index c79b488..7e6c202 100644 --- a/docs/templateSyntax.md +++ b/docs/templateSyntax.md @@ -65,6 +65,8 @@ formats as `23<45` * `butler{ index $string $substring }` Contains reports whether substr is within s. * `butler{ repeat $string $count }` Repeat returns a new string consisting of count copies of the string s. * `butler{ split $string $sep }` Split slices s into all substrings separated by sep and returns a slice of the substrings between those separators. +* `butler{ toLower .Project.Name }` Returns a copy of the string s with all Unicode letters mapped to their lower case. +* `butler{ toUpper $string }` Returns a copy of the string s with all Unicode letters mapped to their upper case. ### Path diff --git a/main.go b/main.go index 2ac5dc0..4718f66 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,7 @@ type commandSelection struct { var ( cfg *config.Config - version = "0.3.0" + version = "0.3.1" primaryCommands = []string{ "Create Project", "Create Confluence Space",