28 local host_mt = { __index = global_config }; |
28 local host_mt = { __index = global_config }; |
29 |
29 |
30 -- When key not found in section, check key in global's section |
30 -- When key not found in section, check key in global's section |
31 function section_mt(section_name) |
31 function section_mt(section_name) |
32 return { __index = function (t, k) |
32 return { __index = function (t, k) |
33 local section = rawget(global_config, section_name); |
33 local section = rawget(global_config, section_name); |
34 if not section then return nil; end |
34 if not section then return nil; end |
35 return section[k]; |
35 return section[k]; |
36 end }; |
36 end |
|
37 }; |
37 end |
38 end |
38 |
39 |
39 function getconfig() |
40 function getconfig() |
40 return config; |
41 return config; |
41 end |
42 end |