simplify commands and version handling

This commit is contained in:
Willy Kloucek
2022-01-03 13:53:27 +01:00
parent eee0d0c4c8
commit e0656daaa0
41 changed files with 437 additions and 499 deletions
+1 -12
View File
@@ -13,14 +13,6 @@ func AccountsCommand(cfg *config.Config) *cli.Command {
Name: "accounts",
Usage: "Start accounts server",
Category: "Extensions",
Subcommands: []*cli.Command{
command.ListAccounts(cfg.Accounts),
command.AddAccount(cfg.Accounts),
command.UpdateAccount(cfg.Accounts),
command.RemoveAccount(cfg.Accounts),
command.InspectAccount(cfg.Accounts),
command.PrintVersion(cfg.Accounts),
},
Before: func(ctx *cli.Context) error {
if err := ParseConfig(ctx, cfg); err != nil {
return err
@@ -32,10 +24,7 @@ func AccountsCommand(cfg *config.Config) *cli.Command {
return nil
},
Action: func(c *cli.Context) error {
origCmd := command.Server(cfg.Accounts)
return handleOriginalAction(c, origCmd)
},
Subcommands: command.GetCommands(cfg.Accounts),
}
}