mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -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)
|
agent = LogStash::Agent.new($0)
|
||||||
begin
|
begin
|
||||||
agent.parse(args)
|
agent.parse(args)
|
||||||
|
@runners << Stud::Task.new { agent.execute }
|
||||||
rescue Clamp::HelpWanted => e
|
rescue Clamp::HelpWanted => e
|
||||||
puts e.command.help
|
puts e.command.help
|
||||||
rescue Clamp::UsageError => e
|
rescue Clamp::UsageError => e
|
||||||
|
@ -196,9 +197,6 @@ class LogStash::Runner
|
||||||
remaining = agent.remaining_arguments
|
remaining = agent.remaining_arguments
|
||||||
end
|
end
|
||||||
|
|
||||||
#require "pry"
|
|
||||||
#binding.pry
|
|
||||||
@runners << Stud::Task.new { agent.execute }
|
|
||||||
return remaining
|
return remaining
|
||||||
end
|
end
|
||||||
} # commands
|
} # commands
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue