From 274a30f7aea0383203aad08c01b06a346def8214 Mon Sep 17 00:00:00 2001 From: the little girl Date: Fri, 27 Sep 2013 18:52:38 +0200 Subject: cli cli --- wiki.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wiki.c b/wiki.c index 36b86cb..e0f4660 100644 --- a/wiki.c +++ b/wiki.c @@ -183,7 +183,7 @@ int view(char *path) { if(!fp) return redirect("?e"); char *page = clean(path); writable(path) ? head(page, "?e", "rediger") : head(page, NULL, NULL); - marxup(fp, stdout); + marxup(fp, stdout, NULL); foot(1); return 0; } @@ -193,6 +193,11 @@ int main(int argc, char **argv) { char *page = getenv("PATH_INFO"); char *query = getenv("QUERY_STRING"); + if(!page && argc > 1) + page = argv[1]; + if(!query && argc > 2) + query = argv[2]; + if(!method) method = "GET"; if(!script) script = getenv("SCRIPT_NAME"); if(!script) script = ""; -- cgit v1.0