commands: cleanup init
This commit is contained in:
parent
f0f8612551
commit
4f6abf1e72
|
@ -32,9 +32,6 @@ func New(ui cli.Ui) *cmd {
|
|||
|
||||
func (c *cmd) init() {
|
||||
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
||||
c.http = &flags.HTTPFlags{}
|
||||
flags.Merge(c.flags, c.http.ClientFlags())
|
||||
|
||||
c.flags.BoolVar(&c.enable, "enable", false,
|
||||
"Enable maintenance mode.")
|
||||
c.flags.BoolVar(&c.disable, "disable", false,
|
||||
|
@ -44,6 +41,8 @@ func (c *cmd) init() {
|
|||
c.flags.StringVar(&c.serviceID, "service", "",
|
||||
"Control maintenance mode for a specific service ID.")
|
||||
|
||||
c.http = &flags.HTTPFlags{}
|
||||
flags.Merge(c.flags, c.http.ClientFlags())
|
||||
c.help = flags.Usage(help, c.flags)
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ type cmd struct {
|
|||
help string
|
||||
flags *flag.FlagSet
|
||||
http *flags.HTTPFlags
|
||||
|
||||
// flags
|
||||
detailed bool
|
||||
wan bool
|
||||
|
@ -37,9 +38,6 @@ func New(ui cli.Ui) *cmd {
|
|||
|
||||
func (c *cmd) init() {
|
||||
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
||||
c.http = &flags.HTTPFlags{}
|
||||
flags.Merge(c.flags, c.http.ClientFlags())
|
||||
|
||||
c.flags.BoolVar(&c.detailed, "detailed", false,
|
||||
"Provides detailed information about nodes.")
|
||||
c.flags.BoolVar(&c.wan, "wan", false,
|
||||
|
@ -51,6 +49,9 @@ func (c *cmd) init() {
|
|||
c.flags.StringVar(&c.segment, "segment", consulapi.AllSegments,
|
||||
"(Enterprise-only) If provided, output is filtered to only nodes in"+
|
||||
"the given segment.")
|
||||
|
||||
c.http = &flags.HTTPFlags{}
|
||||
flags.Merge(c.flags, c.http.ClientFlags())
|
||||
c.help = flags.Usage(help, c.flags)
|
||||
}
|
||||
|
||||
|
|
|
@ -34,12 +34,11 @@ func New(ui cli.Ui, shutdownCh <-chan struct{}) *cmd {
|
|||
|
||||
func (c *cmd) init() {
|
||||
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
||||
c.http = &flags.HTTPFlags{}
|
||||
flags.Merge(c.flags, c.http.ClientFlags())
|
||||
|
||||
c.flags.StringVar(&c.logLevel, "log-level", "INFO",
|
||||
"Log level of the agent.")
|
||||
|
||||
c.http = &flags.HTTPFlags{}
|
||||
flags.Merge(c.flags, c.http.ClientFlags())
|
||||
c.help = flags.Usage(help, c.flags)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue