Update the way flags are used

This commit is contained in:
Asim
2016-01-02 19:12:17 +00:00
parent 1f1bc27421
commit 3b56a62589
9 changed files with 66 additions and 35 deletions

View File

@@ -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) {