From 60a15699657cef86d1a644c0d13b0d117a818633 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 20 May 2024 18:10:43 +0200 Subject: feat: show default configuration with --print-default-config --- internal/config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'internal/config') diff --git a/internal/config/config.go b/internal/config/config.go index 6837ea7..939d7b1 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -180,6 +180,15 @@ var defaultConfig = Config{ }, } +func GetDefaultConfig() string { + out, err := toml.Marshal(&defaultConfig) + if err != nil { + panic("could not read default configuration") + } + + return string(out) +} + func GetConfig(filename string) (*Config, error) { config := defaultConfig if filename != "" { -- cgit 1.4.1