diff --git a/command/maint/maint.go b/command/maint/maint.go index b35df592c8..2524d8e175 100644 --- a/command/maint/maint.go +++ b/command/maint/maint.go @@ -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) } diff --git a/command/members/members.go b/command/members/members.go index 4c3ff92e1a..6def2231dc 100644 --- a/command/members/members.go +++ b/command/members/members.go @@ -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) } diff --git a/command/monitor/monitor.go b/command/monitor/monitor.go index e3c33bb776..502a0fd587 100644 --- a/command/monitor/monitor.go +++ b/command/monitor/monitor.go @@ -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) }