allow implicit agent using directly a flag in cli

Fixes #1296
This commit is contained in:
wiibaa 2014-12-23 13:34:18 +01:00 committed by Jordan Sissel
parent 395cb7563b
commit 98abbafb3d

View file

@ -69,10 +69,21 @@ goto missing_jruby
:EXEC
REM run logstash
set RUBYLIB=%LS_HOME%\lib
if "%VENDORED_JRUBY%" == "" (
%RUBYCMD% "%LS_HOME%\lib\logstash\runner.rb" %*
REM is the first argument a flag? If so, assume 'agent'
set first_arg=%1
setlocal EnableDelayedExpansion
if "!first_arg:~0,1!" equ "-" (
if "%VENDORED_JRUBY%" == "" (
%RUBYCMD% "%LS_HOME%\lib\logstash\runner.rb" agent %*
) else (
%JRUBY_BIN% %jruby_opts% "%LS_HOME%\lib\logstash\runner.rb" agent %*
)
) else (
%JRUBY_BIN% %jruby_opts% "%LS_HOME%\lib\logstash\runner.rb" %*
if "%VENDORED_JRUBY%" == "" (
%RUBYCMD% "%LS_HOME%\lib\logstash\runner.rb" %*
) else (
%JRUBY_BIN% %jruby_opts% "%LS_HOME%\lib\logstash\runner.rb" %*
)
)
goto finally