mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 06:34:18 +02:00
Refactor output code, add JSON, TSV and YAML output modes, add -o (#19), add version subcommand
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"log/slog"
|
||||
|
||||
"codeberg.org/scip/esctl/pkg/cfg"
|
||||
"codeberg.org/scip/esctl/pkg/printer"
|
||||
"github.com/urfave/cli/v3"
|
||||
)
|
||||
|
||||
@@ -65,7 +66,7 @@ func ClusterSettingsList(conf *cfg.Config) error {
|
||||
return fmt.Errorf("failed to get cluster settings: %s", err)
|
||||
}
|
||||
|
||||
table := NewTable(2, 0)
|
||||
table := printer.NewTable(conf, 2, 0)
|
||||
table.Addheaders("setting", "value")
|
||||
entries := [][]string{}
|
||||
|
||||
@@ -94,10 +95,10 @@ func ClusterSettingsList(conf *cfg.Config) error {
|
||||
}
|
||||
}
|
||||
|
||||
table.entries = entries
|
||||
table.Entries = entries
|
||||
table.Sort()
|
||||
|
||||
if err := table.PrintMarkdown(); err != nil {
|
||||
if err := table.Print(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user