]> git.e2factory.org Git - e2factory.git/commitdiff
e2option: log the result of parse()
authorTobias Ulmer <tu@emlix.com>
Mon, 6 Feb 2017 16:04:25 +0000 (17:04 +0100)
committerTobias Ulmer <tu@emlix.com>
Mon, 6 Feb 2017 16:04:25 +0000 (17:04 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2option.lua

index 4f5cdcfc54321a2b1454b65056fea47a43fb9ece..71e101226ace0f337585a290eeda230bba892e7c 100644 (file)
@@ -389,6 +389,18 @@ function e2option.parse(args)
         end
         i = i + 1
     end
+
+    local t = {}
+    for k,v in pairs(opts) do
+        if type(k) == "string" then
+            table.insert(t, string.format("[%s]=%q", k, tostring(v)))
+        end
+    end
+    for k,v in ipairs(vals) do
+        table.insert(t, string.format("[%d]=%q", k, v))
+    end
+    e2lib.logf(3, "e2option.parse(): %s", table.concat(t, ", "))
+
     if opts["Wdefault"] or opts["Wall"] then
         e2lib.globals.warn_category.WDEFAULT = true
     end