about summary refs log tree commit diff stats
path: root/internal
diff options
context:
space:
mode:
authorAlan Pearce2024-05-20 18:10:43 +0200
committerAlan Pearce2024-05-20 18:10:43 +0200
commit60a15699657cef86d1a644c0d13b0d117a818633 (patch)
tree491ac1e698958acb0f9f9ad7d51ce7dd06d76900 /internal
parent6037d5c33e9b98360f61a4fe4f09659d0e3e6160 (diff)
downloadsearchix-60a15699657cef86d1a644c0d13b0d117a818633.tar.lz
searchix-60a15699657cef86d1a644c0d13b0d117a818633.tar.zst
searchix-60a15699657cef86d1a644c0d13b0d117a818633.zip
feat: show default configuration with --print-default-config
Diffstat (limited to 'internal')
-rw-r--r--internal/config/config.go9
1 files changed, 9 insertions, 0 deletions
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 != "" {