From 1f68b5268b71dcb82637dadc9eb93159f7258914 Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Mon, 22 Jun 2015 16:59:41 -0700 Subject: [PATCH] command: event command supports -token arg --- command/event.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/command/event.go b/command/event.go index 8f2cef00e..da4394b53 100644 --- a/command/event.go +++ b/command/event.go @@ -33,12 +33,14 @@ Options: -service="" Regular expression to filter on service instances -tag="" Regular expression to filter on service tags. Must be used with -service. + -token="" ACL token to use during requests. Defaults to that + of the agent. ` return strings.TrimSpace(helpText) } func (c *EventCommand) Run(args []string) int { - var datacenter, name, node, service, tag string + var datacenter, name, node, service, tag, token string cmdFlags := flag.NewFlagSet("event", flag.ContinueOnError) cmdFlags.Usage = func() { c.Ui.Output(c.Help()) } cmdFlags.StringVar(&datacenter, "datacenter", "", "") @@ -46,6 +48,7 @@ func (c *EventCommand) Run(args []string) int { cmdFlags.StringVar(&node, "node", "", "") cmdFlags.StringVar(&service, "service", "", "") cmdFlags.StringVar(&tag, "tag", "", "") + cmdFlags.StringVar(&token, "token", "", "") httpAddr := HTTPAddrFlag(cmdFlags) if err := cmdFlags.Parse(args); err != nil { return 1 @@ -120,6 +123,7 @@ func (c *EventCommand) Run(args []string) int { } opts := &consulapi.WriteOptions{ Datacenter: datacenter, + Token: token, } // Fire the event