mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-12 14:17:47 +00:00
allowing command line delay override the config file again
This commit is contained in:
parent
998f9ab3d0
commit
23dbbe5ecd
28
lsyncd.lua
28
lsyncd.lua
@ -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
|
||||
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user