madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

print_table debug function
authormartin f. krafft <madduck@madduck.net>
Sun, 11 Sep 2016 08:09:42 +0000 (10:09 +0200)
committermartin f. krafft <madduck@madduck.net>
Sun, 11 Sep 2016 08:11:44 +0000 (10:11 +0200)
.config/awesome/rc.lua

index f0b12bf33209d7d9e314a620416120a5e0410a14..d262bf7ddd16ffafb5090d8fb961b80d3ded9724 100644 (file)
@@ -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