diff --git a/src/main.c b/src/main.c index 43170c5..6fd5f72 100644 --- a/src/main.c +++ b/src/main.c @@ -173,7 +173,7 @@ process_cmdline (int argc, char **argv, struct config_s *conf) { int opt; - while ((opt = getopt (argc, argv, "c:vdh")) != EOF) { + while ((opt = getopt (argc, argv, "c:p:vdh")) != EOF) { switch (opt) { case 'v': display_version (); @@ -196,6 +196,10 @@ process_cmdline (int argc, char **argv, struct config_s *conf) } break; + case 'p': + conf->port = strtol(optarg, NULL, 10); + break; + case 'h': display_usage (); exit (EX_OK);