gotmpl

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2019 License: MIT Imports: 6 Imported by: 0

README

CircleCI Go Report Card GoDoc license

gotmpl

Description

gotmpl is a super simple command line program for rendering templates. gotmpl uses environment variables as its context and go-adaptive-functions for its functions.

Installation

No installation is required. Just grab a release. You might want to rename your binary to just gotmpl for convenience.

If you do have go already installed, you can just run using go run main.go or install with bash scripts/install.sh

Usage

See the few examples below.

Note: Since Go templates add the piped value to the end of the positional argument array, gotmpl reorders the piped value to the beginning of the argument array, so go-adaptive-functions can be used. This leads to a more seamless pattern, particularly for functions such as split, join, etc.

Examples

Get Shell

echo '{{ split .SHELL "/" | last }}' | go run main.go

Clean Path

echo '{{ .PATH | split ":" | set | array | sort | join ":" }}' | go run main.go

Contributing

Spatial Current, Inc. is currently accepting pull requests for this repository. We'd love to have your contributions! Please see Contributing.md for how to get started.

License

This work is distributed under the MIT License. See LICENSE file.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL