diff --git a/config/config.go b/config/config.go index bef1771..89a7e57 100644 --- a/config/config.go +++ b/config/config.go @@ -13,6 +13,7 @@ import ( "fmt" "log" "os" + "sort" "strings" "git.wntrmute.dev/kyle/goutils/config/iniconf" @@ -139,3 +140,14 @@ func Require(key string) string { return v } + +// ListKeys returns a slice of the currently known keys. +func ListKeys() []string { + keyList := []string{} + for k := range vars { + keyList = append(keyList, k) + } + + sort.Strings(keyList) + return keyList +}