[hackers] [quark] Allow switching vhosts using flags and rework the usage || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Tue, 11 Jul 2017 15:03:02 +0200 (CEST)

commit d3c1091669a23402196ff239507c5f845af120a6
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Tue Jul 11 15:02:00 2017 +0200
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Tue Jul 11 15:02:00 2017 +0200

    Allow switching vhosts using flags and rework the usage

diff --git a/quark.1 b/quark.1
index 1c133fb..fbf74aa 100644
--- a/quark.1
+++ b/quark.1
_AT_@ -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
_AT_@ -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
index 8a9e936..5b597e0 100644
--- a/quark.c
+++ b/quark.c
_AT_@ -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
_AT_@ -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
Received on Tue Jul 11 2017 - 15:03:02 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 11 2017 - 15:14:22 CEST