Skip to content

Commit

Permalink
gemexp: add -v
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-polo committed Jul 2, 2024
1 parent 55ae6c6 commit 8306bb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");

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

Expand Down
6 changes: 4 additions & 2 deletions gemexp.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8306bb9

Please sign in to comment.