Mercurial > sci
view sciwebd.c @ 9:3ef8128e244f
sci: add project-update command
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 23 Jun 2021 14:05:36 +0200 |
parents | 5fa3d2f479b2 |
children | 3051ef92173a |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include <stdnoreturn.h> #include <unistd.h> #include "http.h" #include "log.h" const char *sock = VARDIR "/run/sci.sock"; noreturn static void usage(void) { fprintf(stderr, "usage: %s [-f] [-s sock]\n", getprogname()); exit(1); } static void init(void) { log_open(getprogname()); } static void finish(void) { log_finish(); } int main(int argc, char **argv) { int ch; void (*run)(void) = &(http_cgi_run); setprogname("sciwebd"); while ((ch = getopt(argc, argv, "fs:")) != -1) { switch (ch) { case 'f': run = &(http_fcgi_run); break; case 's': sock = optarg; break; default: usage(); break; } } init(); run(); finish(); }