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