mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 04:54:18 +02:00
Refactor output code, add JSON, TSV and YAML output modes, add -o (#19), add version subcommand
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"codeberg.org/scip/esctl/pkg/cfg"
|
||||
"codeberg.org/scip/esctl/pkg/printer"
|
||||
)
|
||||
|
||||
// FIXME: add filter support, see IndexCreate mapping
|
||||
@@ -78,12 +79,12 @@ func IndexAliasList(conf *cfg.Config) error {
|
||||
}
|
||||
}
|
||||
|
||||
table := NewTable(2, len(aliaslist))
|
||||
table := printer.NewTable(conf, 2, len(aliaslist))
|
||||
table.Addheaders("index", "alias")
|
||||
|
||||
idx := 0
|
||||
for index, aliases := range aliaslist {
|
||||
table.entries[idx] = []string{
|
||||
table.Entries[idx] = []string{
|
||||
index,
|
||||
strings.Join(aliases, ","),
|
||||
}
|
||||
@@ -93,7 +94,7 @@ func IndexAliasList(conf *cfg.Config) error {
|
||||
|
||||
table.Sort()
|
||||
|
||||
if err := table.PrintMarkdown(); err != nil {
|
||||
if err := table.Print(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user