From b46900566104c0143e06df452fb994e888b23548 Mon Sep 17 00:00:00 2001 From: Kalyan Sriram Date: Mon, 22 Nov 2021 18:37:40 +0000 Subject: config: replace YAML with scfg config format This patch replaces the YAML configuration format with scfg (https://git.sr.ht/~emersion/scfg). Additionally, a few things about configuration are cleaned up: * abbreviated names are expanded (addr -> address, nick -> nickname) * negative bools switched to positive (no-tls -> tls) * independent column widths are grouped under the "pane-width" directive * implementation of default configuration values is improved * password-cmd is executed directly (with scfg field parsing) instead of with "sh -c". * on-highlight is now a file, $XDG_CONFIG_HOME/senpai/highlight by default, which can be changed with the on-highlight-path directive --- cmd/senpai/main.go | 2 +- cmd/test/main.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/senpai/main.go b/cmd/senpai/main.go index 675228f..665cacc 100644 --- a/cmd/senpai/main.go +++ b/cmd/senpai/main.go @@ -34,7 +34,7 @@ func main() { if err != nil { panic(err) } - configPath = path.Join(configDir, "senpai", "senpai.yaml") + configPath = path.Join(configDir, "senpai", "senpai.scfg") } cfg, err := senpai.LoadConfigFile(configPath) diff --git a/cmd/test/main.go b/cmd/test/main.go index 804937f..6eb0574 100644 --- a/cmd/test/main.go +++ b/cmd/test/main.go @@ -108,7 +108,7 @@ func parseFlags() { if err != nil { panic(err) } - configPath = path.Join(configDir, "senpai", "senpai.yaml") + configPath = path.Join(configDir, "senpai", "senpai.scfg") } cfg, err := senpai.LoadConfigFile(configPath) @@ -121,6 +121,6 @@ func parseFlags() { if cfg.Password != nil { password = *cfg.Password } - useTLS = !cfg.NoTLS + useTLS = cfg.TLS } } -- cgit v1.2.3