add sort support to search, add index fields command, fix error messages (#25)

This commit is contained in:
T. von Dein
2026-06-01 12:30:41 +02:00
parent f1877c6903
commit 504db9835d
19 changed files with 233 additions and 63 deletions

View File

@@ -23,7 +23,7 @@ import (
"log/slog"
"codeberg.org/scip/esctl/pkg/cfg"
"codeberg.org/scip/esctl/pkg/printer"
"codeberg.org/scip/esctl/pkg/printer"
"github.com/urfave/cli/v3"
)
@@ -63,7 +63,7 @@ func ClusterSettingsList(conf *cfg.Config) error {
Header("accept", "application/json").
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to get cluster settings: %s", err)
return fmt.Errorf("failed to get cluster settings: %s", esErrorString(err))
}
table := printer.NewTable(conf, 2, 0)
@@ -135,7 +135,7 @@ func ClusterSettingsSet(conf *cfg.Config, args cli.Args) error {
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to set settings: %s", err)
return fmt.Errorf("failed to set settings: %s", esErrorString(err))
}
return nil
@@ -154,7 +154,7 @@ func ClusterSettingsSetSingle(conf *cfg.Config, setting, value string) error {
Do(context.Background())
if err != nil {
return fmt.Errorf("failed to set %s: %s", setting, err)
return fmt.Errorf("failed to set %s: %s", setting, esErrorString(err))
}
return nil