util.lua

changeset 9
13eb9435e1c0
parent 8
6dc28a66f4d9
child 10
58f3707e44d7
--- a/util.lua	Sat Jul 11 02:56:08 2009 +0100
+++ b/util.lua	Sat Jul 11 03:36:57 2009 +0100
@@ -9,8 +9,16 @@
 end
 
 -- Config --
-
-dofile(arg[1] or ".blogrc")
+local conffile = ".blogrc";
+for i=1,#arg do
+	if arg[i] == "-c" or arg[i] == "--config" then
+		table.remove(arg, i);
+		conffile = arg[i] or conffile;
+		table.remove(arg, i);
+		break;
+	end
+end
+dofile(conffile)
 
 posts_dir = posts_dir or "_posts/"
 layouts_dir = layouts_dir or "_layouts/"

mercurial