mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
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
This commit is contained in:
parent
36148fae62
commit
75e6abd985
1 changed files with 1 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue