Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expand ¶
Expand replaces template placeholders in s with runtime values. {profile} → profile name as-is, {Profile} → title-cased, {command} → wrapped command string, {duration} → compact elapsed time, {Duration} → spoken elapsed time.
ORDER MATTERS: uppercase variants ({Duration}, {Time}, {Date}, {Profile}) must be replaced before their lowercase counterparts. Otherwise "{Duration}" partially matches "{duration}" (a prefix), producing corrupted output. Do not reorder these replacements.
Types ¶
type Vars ¶ added in v0.2.0
type Vars struct {
Profile string
Command string
Duration string // compact: "2m15s"
DurationSay string // spoken: "2 minutes and 15 seconds"
Time string // compact: "15:04"
TimeSay string // spoken: "3:04 PM"
Date string // compact: "2006-01-02"
DateSay string // spoken: "January 2, 2006"
Hostname string
Output string // last N lines of wrapped command output
}
Vars holds runtime values for template expansion.
Click to show internal directories.
Click to hide internal directories.