allowing command line delay override the config file again

This commit is contained in:
Axel Kittenberger 2012-10-07 21:40:05 +02:00
parent 998f9ab3d0
commit 23dbbe5ecd
1 changed files with 19 additions and 9 deletions

View File

@ -65,6 +65,12 @@ local Monitors
--
local processCount = 0
--
-- Settings specified by command line.
--
local clSettings = { }
--============================================================================
-- Lsyncd Prototypes
--============================================================================
@ -2270,7 +2276,8 @@ local Syncs = ( function( )
'maxDelays',
'maxProcesses'
}
-- Lets settings or commandline override these values.
-- Lets settings override these values.
if settings then
for _, v in ipairs( inheritSettings ) do
if settings[ v ] then
@ -2279,6 +2286,15 @@ local Syncs = ( function( )
end
end
-- Lets commandline override these values.
if clSettings then
for _, v in ipairs( inheritSettings ) do
if clSettings[ v ] then
config[ v ] = clSettings[ v ]
end
end
end
--
-- lets the userscript 'prepare' function
-- check and complete the config
@ -3520,11 +3536,6 @@ SEE:
end
--
-- Settings specified by command line.
--
local clSettings = { }
--
-- Called from core to parse the command line arguments
--
@ -3535,7 +3546,7 @@ local clSettings = { }
--
function runner.configure( args, monitors )
Monitors.initialize (monitors )
Monitors.initialize( monitors )
-- a list of all valid options
--
@ -3760,7 +3771,7 @@ function runner.initialize( firstTime )
--
-- creates settings if user didnt
--
settings = settings or {}
settings = settings or { }
--
-- From this point on, no globals may be created anymore
@ -3790,7 +3801,6 @@ function runner.initialize( firstTime )
if k ~= 'syncs' then
settings[ k ] = v
end
end
--