don't warn of wrong path.settings with --help

Fixes #5786
This commit is contained in:
Joao Duarte 2016-08-22 15:42:07 +01:00 committed by João Duarte
parent c9eff28fb2
commit 60cf97c8c2

View file

@ -148,12 +148,13 @@ class LogStash::Runner < Clamp::StrictCommand
begin
LogStash::SETTINGS.from_yaml(LogStash::SETTINGS.get("path.settings"))
rescue => e
@logger.subscribe(STDOUT)
@logger.warn("Logstash has a new settings file which defines start up time settings. This file is typically located in $LS_HOME/config or /etc/logstash. If you installed Logstash through a package and are starting it manually please specify the location to this settings file by passing in \"--path.settings=/path/..\" in the command line options")
@logger.fatal("Failed to load settings file from \"path.settings\". Aborting...", "path.settings" => LogStash::SETTINGS.get("path.settings"), "exception" => e.class, "message" => e.message)
# abort unless we're just looking for the help
return(1) if (["--help", "-h"] & args).empty?
if (["--help", "-h"] & args).empty?
@logger.subscribe(STDOUT)
@logger.warn("Logstash has a new settings file which defines start up time settings. This file is typically located in $LS_HOME/config or /etc/logstash. If you installed Logstash through a package and are starting it manually please specify the location to this settings file by passing in \"--path.settings=/path/..\" in the command line options")
@logger.fatal("Failed to load settings file from \"path.settings\". Aborting...", "path.settings" => LogStash::SETTINGS.get("path.settings"), "exception" => e.class, "message" => e.message)
return 1
end
end
super(*[args])