Update the way flags are used
This commit is contained in:
13
options.go
13
options.go
@@ -1,6 +1,7 @@
|
||||
package gomicro
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/micro/go-micro/broker"
|
||||
"github.com/micro/go-micro/client"
|
||||
"github.com/micro/go-micro/cmd"
|
||||
@@ -95,6 +96,18 @@ func Version(v string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func Flags(flags ...cli.Flag) Option {
|
||||
return func(o *Options) {
|
||||
o.Cmd.App().Flags = append(o.Cmd.App().Flags, flags...)
|
||||
}
|
||||
}
|
||||
|
||||
func Action(a func(*cli.Context)) Option {
|
||||
return func(o *Options) {
|
||||
o.Cmd.App().Action = a
|
||||
}
|
||||
}
|
||||
|
||||
// Metadata associated with the service
|
||||
func Metadata(md map[string]string) Option {
|
||||
return func(o *Options) {
|
||||
|
Reference in New Issue
Block a user