local argparser = require("argparser") local lilgit = require("lilgit") local parser = argparser .command("lilgit") :summary("Read-only git HTTP frontend: smart-HTTP clone plus tree/blob/raw browsing.") :option("ip", { type = "string", note = "Address to listen on" }) :option("port", { type = "number", short = "p", note = "Port to listen on" }) :option("dir", { type = "dir", short = "d", note = "Directory containing git repositories" }) :option("title", { type = "string", short = "t", note = "Site title" }) :build() local parsed, err = parser:parse(arg) if not parsed then print(argparser.format_error(err)) os.exit(err and err.kind == "help" and 0 or 1) end -- Only flags actually given end up in the override, so they never -- clobber config file values with defaults. local app, a_err = lilgit.new({ ip = parsed.ip, port = parsed.port, repos_dir = parsed.dir, site_title = parsed.title, }) if not app then print("failed to init lilgit: " .. tostring(a_err)) os.exit(1) end app:run()