Documentation ¶
Overview ¶
Package yaml is an internal package for parsing config files into a format that is similar to cobra commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasNameCollisions ¶ added in v0.2.0
func HasNameCollisions(configs []OneTerminalConfig) error
HasNameCollisions returns an error if multiple configs have the same name, alias or one of the reserved names (for built in oneterminal cmds like help)
func WriteExampleConfig ¶ added in v0.4.1
WriteExampleConfig makes an example oneterminal yaml config at ~/.config/oneterminal/example.yml with comments describing each field
Types ¶
type Command ¶
type Command struct { Name string `yaml:"name"` Command string `yaml:"command"` CmdDir string `yaml:"directory,omitempty"` Silence bool `yaml:"silence,omitempty"` ReadyRegexp string `yaml:"ready-regexp,omitempty"` DependsOn []string `yaml:"depends-on,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` }
Command is what will run in one terminal "window"/tab
type OneTerminalConfig ¶
type OneTerminalConfig struct { Name string `yaml:"name"` Alias string `yaml:"alias"` Shell string `yaml:"shell"` Short string `yaml:"short"` Long string `yaml:"long,omitempty"` Commands []Command `yaml:"commands"` }
OneTerminalConfig of all the fields from a yaml config
func ParseAllConfigs ¶ added in v0.2.0
func ParseAllConfigs() ([]OneTerminalConfig, error)
ParseAllConfigs parses and returns configs in ~/.config/oneterminal
Click to show internal directories.
Click to hide internal directories.