mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 09:54:18 +02:00
Add CCR stuff, fix search, add docs support, support index maps, refactor (#13)
This commit is contained in:
26
cmd/index.go
26
cmd/index.go
@@ -69,11 +69,7 @@ func IndexList(conf *cfg.Config) *cli.Command {
|
||||
},
|
||||
|
||||
Action: func(ctx context.Context, cmd *cli.Command) error {
|
||||
if err := es.IndexList(conf); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return es.IndexList(conf)
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -85,11 +81,8 @@ func IndexShow(conf *cfg.Config) *cli.Command {
|
||||
Usage: "show details about an index",
|
||||
|
||||
Action: func(ctx context.Context, cmd *cli.Command) error {
|
||||
if err := es.IndexShow(conf, cmd.Args().Get(0)); err != nil {
|
||||
return err
|
||||
}
|
||||
return es.IndexShow(conf, cmd.Args().Get(0))
|
||||
|
||||
return nil
|
||||
},
|
||||
|
||||
// FIXME: doesn't work at all
|
||||
@@ -140,11 +133,14 @@ func IndexCreate(conf *cfg.Config) *cli.Command {
|
||||
},
|
||||
|
||||
Action: func(ctx context.Context, cmd *cli.Command) error {
|
||||
if err := es.IndexCreate(conf, cmd.Args().Get(0)); err != nil {
|
||||
return err
|
||||
args := cmd.Args()
|
||||
if args.Len() == 0 {
|
||||
return fmt.Errorf("no index specified")
|
||||
}
|
||||
|
||||
return nil
|
||||
mappings := args.Slice()[1:]
|
||||
|
||||
return es.IndexCreate(conf, args.Get(0), mappings)
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -156,11 +152,7 @@ func IndexDelete(conf *cfg.Config) *cli.Command {
|
||||
Usage: "delete an index",
|
||||
|
||||
Action: func(ctx context.Context, cmd *cli.Command) error {
|
||||
if err := es.IndexDelete(conf, cmd.Args().Get(0)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return es.IndexDelete(conf, cmd.Args().Get(0))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user