add -p -t -D flags to cluster settings ls (#10)

This commit is contained in:
T. von Dein
2026-05-06 07:25:27 +02:00
parent a71be5001a
commit af75bfa192
3 changed files with 45 additions and 15 deletions

View File

@@ -147,7 +147,16 @@ func ClusterSettingsList(conf *cfg.Config) error {
table.Addheaders("setting", "value")
entries := [][]string{}
for topic, val := range res.Persistent {
settingshash := res.Persistent // == map[string]json.RawMessage
switch {
case conf.Transient:
settingshash = res.Transient
case conf.Default:
settingshash = res.Defaults
}
for topic, val := range settingshash {
data := map[string]map[string]any{}
err := json.Unmarshal(val, &data)