quark

quark web server
git clone git://git.suckless.org/quark
Log | Files | Refs | LICENSE

commit d3c1091669a23402196ff239507c5f845af120a6
parent 141bb88af14489c14bf47259b63098331f7c3076
Author: Laslo Hunhold <dev@frign.de>
Date:   Tue, 11 Jul 2017 15:02:00 +0200

Allow switching vhosts using flags and rework the usage

Diffstat:
quark.1 | 23+++++++++++------------
quark.c | 13+++++++------
2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/quark.1 b/quark.1 @@ -1,24 +1,21 @@ -.Dd 2016-09-02 +.Dd 2017-07-11 .Dt QUARK 1 .Sh NAME .Nm quark .Nd simple web server .Sh SYNOPSIS .Nm +.Op Fl l | L +.Op Fl v | V +.Oo +.Oo .Op Fl h Ar host .Op Fl p Ar port -.Op Fl v -.Op Fl d Ar dir -.Op Fl l -.Op Fl L -.Op Fl u Ar user -.Op Fl g Ar group -.Nm +.Oc +| .Op Fl U Ar sockfile -.Op Fl v +.Oc .Op Fl d Ar dir -.Op Fl l -.Op Fl L .Op Fl u Ar user .Op Fl g Ar group .Sh DESCRIPTION @@ -57,7 +54,9 @@ Create the UNIX-domain socket file and listen on it for incoming connections. The file will be cleaned up at exit. .It Fl v -Print version information to stdout and exit. +Disable virtual hosts. +.It Fl V +Enable virtual hosts. .El .Sh CUSTOMIZATION .Nm diff --git a/quark.c b/quark.c @@ -940,10 +940,8 @@ sigcleanup(int sig) static void usage(void) { - char *opts = "[-v] [-d dir] [-l] [-L] [-u user] [-g group]"; - - die("usage: %s [-h host] [-p port] %s\n" - " %s [-U sockfile] %s\n", argv0, opts, argv0, opts); + die("usage: %s [-l | -L] [-v | -V] [[[-h host] [-p port]] | [-U sockfile]] " + "[-d dir] [-u user] [-g group]\n", argv0); } int @@ -981,8 +979,11 @@ main(int argc, char *argv[]) udsname = EARGF(usage()); break; case 'v': - fputs("quark-"VERSION"\n", stderr); - return 0; + vhosts = 0; + break; + case 'V': + vhosts = 1; + break; default: usage(); } ARGEND