mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 08:14:18 +02:00
add "cluster ls", put "status" into "cluster status" (#5)
This commit is contained in:
@@ -34,6 +34,49 @@ func Cluster(conf *cfg.Config) *cli.Command {
|
||||
|
||||
Commands: []*cli.Command{
|
||||
Compare(conf),
|
||||
Status(conf),
|
||||
List(conf),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func List(conf *cfg.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "list",
|
||||
Usage: "list configured clusters",
|
||||
Aliases: []string{"ls"},
|
||||
|
||||
Action: func(ctx context.Context, cmd *cli.Command) error {
|
||||
if err := es.List(conf); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func Status(conf *cfg.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "status",
|
||||
Usage: "show cluster status",
|
||||
Aliases: []string{"s"},
|
||||
|
||||
Flags: []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "all",
|
||||
Usage: "show status of all clusters",
|
||||
Destination: &conf.All,
|
||||
Aliases: []string{"a"},
|
||||
},
|
||||
},
|
||||
|
||||
Action: func(ctx context.Context, cmd *cli.Command) error {
|
||||
if err := es.Status(conf); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user