cmdxtmpl

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cmdxtmpl expands fasttemplate tags ({{ }}) in command argument vectors, delegating each tag to a caller-supplied resolver. It builds and runs nothing: strings in, strings out.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interpolate

func Interpolate(args []string, resolve func(tag string) (string, error)) ([]string, error)

Interpolate returns a new slice the same length as args, with every {{ }} tag in each element replaced by the result of resolve. Whitespace surrounding the inner text is trimmed before resolve sees it, so {{ env.SHELL }} and {{env.SHELL}} are equivalent. Element count is invariant: tags are never split on whitespace and empty results are preserved in place.

The first resolve error aborts the call and is returned wrapped with the element index and tag; on success the input is never mutated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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