cleanup root command and use registry to load commands

This commit is contained in:
A.Unger
2020-01-09 14:34:57 +01:00
parent 42034052f5
commit e0c2aa76cd

View File

@@ -74,15 +74,8 @@ func Execute() error {
return nil
},
Commands: []cli.Command{
Server(cfg),
Health(cfg),
},
}
// TODO(refs) fix this interface and make it play nice with cli.Command to reuse and skip
// doing runtime.AddRuntime(app)
for _, fn := range register.Commands {
app.Commands = append(
app.Commands,
@@ -90,10 +83,7 @@ func Execute() error {
)
}
// add runtime commands to the binary
runtime.AddRuntime(app)
// add the runtime.Run command to the binary
app.Commands = append(
app.Commands,
runtime.Command(app),