From: martin f. krafft Date: Sun, 11 Sep 2016 08:09:42 +0000 (+0200) Subject: print_table debug function X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/648541413429f405df2d7ab94a03e75b39dd0b23?ds=inline print_table debug function --- diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index f0b12bf..d262bf7 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -93,6 +93,19 @@ local function client_menu_toggle_fn() end end end + +local function print_table(tbl, indent) + if not indent then indent = 0 end + for k, v in pairs(tbl) do + formatting = string.rep(" ", indent) .. k .. ": " + if type(v) == "table" then + print(formatting) + print_table(v, indent+1) + else + print(formatting .. tostring(v)) + end + end +end -- }}} -- {{{ Menu