summary refs log tree commit diff
path: root/server.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-07-09 23:56:31 -0400
committerJune McEnroe <june@causal.agency>2020-07-09 23:56:31 -0400
commit50ad4e1b09e32148628427baa47e96fc829adb23 (patch)
tree4efc749c560d49615b466de832d5514291b56b99 /server.c
parentAdd before param in redirect (diff)
downloadscooper-50ad4e1b09e32148628427baa47e96fc829adb23.tar.gz
scooper-50ad4e1b09e32148628427baa47e96fc829adb23.zip
Add -c to check SQL queries
Diffstat (limited to 'server.c')
-rw-r--r--server.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/server.c b/server.c
index 3dcdea3..751d414 100644
--- a/server.c
+++ b/server.c
@@ -63,9 +63,11 @@ static enum kcgi_err request(struct kreq *req) {
 
 int main(int argc, char *argv[]) {
 	bool fastCGI = false;
+	bool test = false;
 
-	for (int opt; 0 < (opt = getopt(argc, argv, "fps:"));) {
+	for (int opt; 0 < (opt = getopt(argc, argv, "cfps:"));) {
 		switch (opt) {
+			break; case 'c': test = true;
 			break; case 'f': fastCGI = true;
 			break; case 'p': pagePublic = true;
 			break; case 's': htmlStylesheet = optarg;
@@ -98,6 +100,8 @@ int main(int argc, char *argv[]) {
 	prepare(&stmt.eventsAfter, EventsAfterQuery);
 	prepare(&stmt.eventsBefore, EventsBeforeQuery);
 	
+	if (test) return EX_OK;
+	
 	if (fastCGI) {
 		struct kfcgi *fcgi;
 		enum kcgi_err error = khttp_fcgi_init(