Commit f5a07231 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

Log: deterministic option ordering

parent f8874412
......@@ -54,7 +54,8 @@ function Log:optfrags()
local targets = {}
if mode then
local optmap = {
local optmap = (
log={level='level', prefix='prefix'},
......@@ -69,14 +70,15 @@ function Log:optfrags()
if not optmap[mode] then self:error('Invalid logging mode: '..mode) end
if not optmap then self:error('Invalid logging mode: '..mode) end
local target = mode:upper()
for s, t in pairs(optmap[mode]) do
for _, s in util.sortedkeys(optmap) do
local value = self[s]
if value then
if s == 'prefix' then value = util.quote(value) end
target = target..' --'..mode..'-'..t..' '..value
target = target..' --'..mode..'-'..optmap[s]..' '..value
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment