Skip to content

Commit

Permalink
Fix help being printed twice.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jordansissel committed Mar 12, 2014
1 parent 36148fa commit 75e6abd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/logstash/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def wait
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
Expand All @@ -196,9 +197,6 @@ def wait
remaining = agent.remaining_arguments
end

#require "pry"
#binding.pry
@runners << Stud::Task.new { agent.execute }
return remaining
end
} # commands
Expand Down

0 comments on commit 75e6abd

Please sign in to comment.