gemexp: add -v

This commit is contained in:
Omar Polo 2024-07-02 22:07:23 +00:00
parent 55ae6c66b2
commit 8306bb90d1
2 changed files with 12 additions and 4 deletions

10
ge.c
View File

@ -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);

View File

@ -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.