Documentation
¶
Overview ¶
Package config loads the optional TOML configuration. Problems never stop the program: they become warnings (statusbar in the TUI, stderr in the CLI) and the affected values keep their defaults.
Index ¶
Constants ¶
const ( MaxDebounceMS = 2000 MinLiveMaxBytes = 1 << 10 MaxLiveMaxBytes = 1 << 20 )
Limits for numeric settings.
const EnvVar = "DEVTOOLTUI_CONFIG"
EnvVar overrides the config path (the --config flag wins over it).
Variables ¶
This section is empty.
Functions ¶
func OptionValue ¶
OptionValue checks v (decoded from TOML or JSON) against the option kind, as registry.New does for Spec defaults, and returns it with the Go type of that kind. On failure it returns a message.
func Path ¶
func Path(flag string, getenv func(string) string, userConfigDir func() (string, error)) (path string, explicit bool, err error)
Path returns the config file to read: flag, then $DEVTOOLTUI_CONFIG, then <user config dir>/devtooltui/config.toml. explicit tells whether the user chose it, so a missing file deserves a warning.
Types ¶
type Config ¶
type Config struct {
Theme string // auto | dark | light
DetectOnStart bool
DebounceMS int
LiveMaxBytes int // above it, the input is read-only and runs with F5 (ADR 0002)
History History
Tools map[string]tool.Values // validated defaults per tool ID
Keys map[string]string // keymap overrides, validated by the TUI
}
Config is the content of config.toml.