From 75e6abd9852e11df2f55ce254790a2f0813ef43b Mon Sep 17 00:00:00 2001 From: Jordan Sissel Date: Wed, 12 Mar 2014 16:40:48 -0700 Subject: [PATCH] Fix help being printed twice. The bug was caused by 'agent.parse' failing with Clamp::HelpWanted and then we would continue onward to try and actually run the agent. Now we only run the agent if parsing args succeeds. Fixes LOGSTASH-1952 --- lib/logstash/runner.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/logstash/runner.rb b/lib/logstash/runner.rb index 6431e0244..78f00ce31 100644 --- a/lib/logstash/runner.rb +++ b/lib/logstash/runner.rb @@ -187,6 +187,7 @@ class LogStash::Runner agent = LogStash::Agent.new($0) begin agent.parse(args) + @runners << Stud::Task.new { agent.execute } rescue Clamp::HelpWanted => e puts e.command.help rescue Clamp::UsageError => e @@ -196,9 +197,6 @@ class LogStash::Runner remaining = agent.remaining_arguments end - #require "pry" - #binding.pry - @runners << Stud::Task.new { agent.execute } return remaining end } # commands