# HG changeset patch # User Matthew Wild # Date 1247279817 -3600 # Node ID 13eb9435e1c06007023feeec516630a0773001b3 # Parent 6dc28a66f4d9fc1803a3ff284b48a64209dc1a72 Allow config file to be specified with flag on the command-line diff -r 6dc28a66f4d9 -r 13eb9435e1c0 util.lua --- 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/"