mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
Allow setting of actions
This commit is contained in:
parent
1da6de05ee
commit
c3e9ba6b85
@ -26,6 +26,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Actions = []func(*cli.Context){}
|
||||
|
||||
Flags = []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "server_name",
|
||||
@ -283,7 +285,11 @@ GLOBAL OPTIONS:
|
||||
app := cli.NewApp()
|
||||
app.HideVersion = true
|
||||
app.Usage = "a go micro app"
|
||||
app.Action = func(c *cli.Context) {}
|
||||
app.Action = func(c *cli.Context) {
|
||||
for _, action := range Actions {
|
||||
action(c)
|
||||
}
|
||||
}
|
||||
app.Before = Setup
|
||||
app.Flags = Flags
|
||||
app.RunAndExitOnError()
|
||||
|
Loading…
Reference in New Issue
Block a user