aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2024-07-02 22:07:23 +0000
committerOmar Polo <op@omarpolo.com>2024-07-02 22:07:23 +0000
commit8306bb90d1378b32a56f909e973ee6344515cd37 (patch)
tree7cdcb21a504d7a0075b85fb81b813f14726a8feb
parent55ae6c66b2be05e4355b9434a689b19a31a4d693 (diff)
gemexp: add -v
-rw-r--r--ge.c10
-rw-r--r--gemexp.16
2 files changed, 12 insertions, 4 deletions
diff --git a/ge.c b/ge.c
index e265090..ecbba5c 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 d67d9b1..f4f403f 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.