From 43ea91b8a2f6526cffef39e8d5ce87b7c48bb05d Mon Sep 17 00:00:00 2001 From: Drew Bailey <2614075+drewbailey@users.noreply.github.com> Date: Fri, 1 Nov 2019 11:06:49 -0400 Subject: [PATCH] monitor command takes no args rm extra new line --- api/agent.go | 1 - command/agent/monitor/monitor_test.go | 1 - command/agent_monitor.go | 7 +++++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/agent.go b/api/agent.go index 936ac1e4c192..fdd5ff891d94 100644 --- a/api/agent.go +++ b/api/agent.go @@ -244,7 +244,6 @@ type MonitorFrame struct { // Monitor returns a channel which will receive streaming logs from the agent // Providing a non-nil stopCh can be used to close the connection and stop log streaming func (a *Agent) Monitor(stopCh <-chan struct{}, q *QueryOptions) (<-chan *StreamFrame, <-chan error) { - errCh := make(chan error, 1) r, err := a.client.newRequest("GET", "/v1/agent/monitor") if err != nil { diff --git a/command/agent/monitor/monitor_test.go b/command/agent/monitor/monitor_test.go index bb6cedaf224e..edf1f84f5c02 100644 --- a/command/agent/monitor/monitor_test.go +++ b/command/agent/monitor/monitor_test.go @@ -61,7 +61,6 @@ func TestMonitor_DroppedMessages(t *testing.T) { } received := "" - passed := make(chan struct{}) go func() { for { diff --git a/command/agent_monitor.go b/command/agent_monitor.go index ba5dbd0dfc2a..3fc86d48cd78 100644 --- a/command/agent_monitor.go +++ b/command/agent_monitor.go @@ -74,6 +74,13 @@ func (c *MonitorCommand) Run(args []string) int { return 1 } + args = flags.Args() + if l := len(args); l != 0 { + c.Ui.Error("This command takes no arguments") + c.Ui.Error(commandErrorText(c)) + return 1 + } + client, err := c.Meta.Client() if err != nil { c.Ui.Error(fmt.Sprintf("Error initializing client: %s", err))