From 8306bb90d1378b32a56f909e973ee6344515cd37 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Tue, 2 Jul 2024 22:07:23 +0000 Subject: [PATCH] gemexp: add -v --- ge.c | 10 ++++++++-- gemexp.1 | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ge.c b/ge.c index e2650902..ecbba5c1 100644 --- a/ge.c +++ b/ge.c @@ -266,7 +266,7 @@ main(int argc, char **argv) struct location *loc; const char *errstr, *certs_dir = NULL, *hostname = "localhost"; char path[PATH_MAX]; - int ch, port = 1965; + int ch, verbose = 0, port = 1965; setlocale(LC_CTYPE, ""); @@ -276,7 +276,7 @@ main(int argc, char **argv) /* ge doesn't do privsep so no privsep crypto engine. */ conf->use_privsep_crypto = 0; - while ((ch = getopt_long(argc, argv, "d:H:hp:RV", opts, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, "d:H:hp:RVv", opts, NULL)) != -1) { switch (ch) { case 'd': certs_dir = optarg; @@ -299,6 +299,9 @@ main(int argc, char **argv) case 'V': puts("Version: " GEMEXP_STRING); return 0; + case 'v': + verbose = 1; + break; default: usage(); break; @@ -310,6 +313,9 @@ main(int argc, char **argv) if (argc > 1) usage(); + log_init(1, LOG_DAEMON); + log_setverbose(verbose); + /* prepare the configuration */ init_mime(&conf->mime); diff --git a/gemexp.1 b/gemexp.1 index d67d9b18..f4f403ff 100644 --- a/gemexp.1 +++ b/gemexp.1 @@ -11,7 +11,7 @@ .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.Dd October 18, 2023 +.Dd July 3, 2024 .Dt GEMEXP 1 .Os .Sh NAME @@ -20,7 +20,7 @@ .Sh SYNOPSIS .Nm .Bk -words -.Op Fl hRV +.Op Fl hRVv .Op Fl d Ar certs-dir .Op Fl H Ar hostname .Op Fl p Ar port @@ -69,6 +69,8 @@ The port to bind to, 1965 by default. Generate an RSA key instead of an EC one. .It Fl V , Fl -version Print the version and exit. +.It Fl v +Verbose mode. .It Ar directory The root directory to serve, or the current working directory if not specified.