mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 17:24: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/elastic/go-elasticsearch/v9/typedapi/types"
|
||||
)
|
||||
|
||||
@@ -115,10 +116,10 @@ func CcrRemoteInfo(conf *cfg.Config, index string) error {
|
||||
mode = "leader"
|
||||
}
|
||||
|
||||
table := NewTable(2, 5)
|
||||
table := printer.NewTable(conf, 2, 5)
|
||||
table.Addheaders("ccr remote property", "value")
|
||||
|
||||
table.entries = [][]string{
|
||||
table.Entries = [][]string{
|
||||
{"Remote Cluster", remote},
|
||||
{"CCR Mode", mode},
|
||||
{"Connected", fmt.Sprintf("%t", info.Connected)},
|
||||
@@ -126,7 +127,7 @@ func CcrRemoteInfo(conf *cfg.Config, index string) error {
|
||||
{"Proxy Address", info.ProxyAddress},
|
||||
}
|
||||
|
||||
if err := table.PrintMarkdown(); err != nil {
|
||||
if err := table.Print(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user