Documentation
¶
Overview ¶
Package tmuxopt provides an API for loading and parsing tmux options into Go variables.
It provides an API similar to the flag package, but for tmux options.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
Loader loads tmux options into user-specified variables.
func (*Loader) Load ¶
func (l *Loader) Load(req tmux.ShowOptionsRequest) (err error)
Load loads tmux options using the underlying tmux.Driver with the provided request. This will fill all previously specified values and vars.
func (*Loader) MapVar ¶ added in v0.3.0
MapVar specifies that options with the given prefix should be loaded into the provided MapValue.
To support maps, tmuxopt loader works by matching the provided prefix against options produced by tmux. If an option name matches the given prefix, the rest of that name is used as the map key and the value for that option as the value for that key.
For example, if the prefix is, "foo-item-", then given the following options,
foo-item-a x foo-item-b y foo-item-c z
We'll get the map,
{a: x, b: y, c: z}