diff --git a/lsyncd.lua b/lsyncd.lua index f779881..1b567f5 100644 --- a/lsyncd.lua +++ b/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 --